Skip to content

Commit

Permalink
[fix] fix the schema
Browse files Browse the repository at this point in the history
  • Loading branch information
MangoIV committed Oct 9, 2023
1 parent 35a21f1 commit 293b6f6
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions libs/wire-api/src/Wire/API/Routes/Internal/Brig.hs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ where

import Control.Lens ((.~))
import Data.Aeson (FromJSON, ToJSON)
import Data.Aeson qualified as Aeson
import Data.Code qualified as Code
import Data.CommaSeparatedList
import Data.Domain (Domain)
Expand Down Expand Up @@ -696,13 +695,13 @@ type InvitationCode =
:> Get '[Servant.JSON] FoundInvitationCode
)

newtype FoundInvitationCode = FoundInvitationCode User.InvitationCode
newtype FoundInvitationCode = FoundInvitationCode {getFoundInvitationCode :: User.InvitationCode}
deriving stock (Eq, Show, Generic)
-- TODO: is this correct?
deriving newtype (S.ToSchema)
deriving (FromJSON, ToJSON, S.ToSchema) via (Schema FoundInvitationCode)

instance ToJSON FoundInvitationCode where
toJSON (FoundInvitationCode c) = Aeson.object ["code" Aeson..= c]
instance ToSchema FoundInvitationCode where
schema = FoundInvitationCode <$>
getFoundInvitationCode .= object "FoundInvitationCode" (field "code" (schema @User.InvitationCode))

type SuspendTeam =
Named
Expand Down

0 comments on commit 293b6f6

Please sign in to comment.