SQSERVICES 1011 Servantify Galley/Team API#2008
Conversation
libs/wire-api/src/Wire/API/Team.hs
Outdated
| deriving (S.ToSchema) via (Schema NonBindingNewTeam) | ||
|
|
||
| instance ToSchema NonBindingNewTeam where | ||
| schema = error "todo" |
There was a problem hiding this comment.
I missed this, will fix it
There was a problem hiding this comment.
argh!! we should not have non-binding teams any more in the code, they have never been implemented on the client side and have been dead code since the beginning. i expect this to take less than an hour, but now i want to remove non-binding teams again. immediately!
fisx
left a comment
There was a problem hiding this comment.
sorry about missing the non-binding teams thing in the issue, but i'm hopeful that most of the code is still going to be usdful for non-dead end-points?
I can take another look tomorrow when the last hole is filled, then this should be good to merge.
| testObject_NewTeamMember_team_20 :: NewTeamMember | ||
| testObject_NewTeamMember_team_20 = | ||
| ( newNewTeamMember | ||
| ( mkNewTeamMember |
There was a problem hiding this comment.
it would be helpful if you did these renamings in separate PRs.
| Sem r Response | ||
| getTeamMemberH (zusr ::: tid ::: uid ::: _) = do | ||
| (member, withPerms) <- getTeamMember zusr tid uid | ||
| -- pure $ member & permissions .~ \p -> guard (withPerms member) $> p |
pcapriotti
left a comment
There was a problem hiding this comment.
Looks good to me, except for the missing schema. I guess since we don't need this endpoint at all, it's maybe better if we just remove it instead of servantifying it (and then we don't need the missing schema either).
I left some minor comments, most of which are about mistakes that I made.
|
|
||
| deriving instance Show (PermissionType tag) => Show (TeamMember' tag) | ||
|
|
||
| deriving instance Generic (TeamMember' tag) |
There was a problem hiding this comment.
This one instance has no context, so it doesn't need to be standalone.
| -- FUTUREWORK: | ||
| -- There must be a cleaner way to do this, with a separate type | ||
| -- instead of logic in the JSON instance. |
There was a problem hiding this comment.
We can remove this FUTUREWORK now.
|
|
||
| deriving instance (Show (PermissionType tag)) => Show (NewTeamMember' tag) | ||
|
|
||
| deriving instance (Generic (PermissionType tag)) => Generic (NewTeamMember' tag) |
There was a problem hiding this comment.
This doesn't need a context, so it can also be a normal deriving clause.
| invitation :: Lens' TeamMember (Maybe (UserId, UTCTimeMillis)) | ||
| invitation = newTeamMember . nInvitation | ||
|
|
||
| -- JSON serialisation utilities (TODO: remove after servantification) |
There was a problem hiding this comment.
Since these are staying for the time being, we should turn the TODO into a FUTUREWORK.
| Sem r Response | ||
| getTeamMemberH (zusr ::: tid ::: uid ::: _) = do | ||
| (member, withPerms) <- getTeamMember zusr tid uid | ||
| -- pure $ member & permissions .~ \p -> guard (withPerms member) $> p |
There was a problem hiding this comment.
| -- pure $ member & permissions .~ \p -> guard (withPerms member) $> p |
|
|
I merged the schemas for binding and non-binding |
https://wearezeta.atlassian.net/browse/SQSERVICES-1011
Checklist
changelog.d.