1
0

Use team update route to update a team member's admin status

This commit is contained in:
kolaente
2020-08-05 17:32:18 +02:00
parent b779500240
commit 903cdcc93a
2 changed files with 16 additions and 9 deletions

View File

@ -7,7 +7,8 @@ export default class TeamMemberService extends AbstractService {
super({
create: '/teams/{teamId}/members',
delete: '/teams/{teamId}/members/{username}',
});
update: '/teams/{teamId}/members/{username}/admin',
})
}
processModel(model) {
@ -19,7 +20,7 @@ export default class TeamMemberService extends AbstractService {
modelFactory(data) {
return new TeamMemberModel(data)
}
beforeCreate(model) {
model.userId = model.id // The api wants to get the user id as user_Id
model.admin = model.admin === null ? false : model.admin