Client Add Manage Actions

This commit is contained in:
Barry Low committed 2018-09-14 08:43:07 -07:00
1 parent f2aae81f6e
commit 19f1ea54e4
6 files changed
+105 -111

No files matched your search

+3 -3
View File
@@ -101,14 +101,14 @@ const resolvers = {
})
},
async updateTeamProfile(parent, { slug, owner, description, motto, avatar }, ctx, info) {
return ctx.db.mutation.updateTeam({data:{profile: {update: {description: description, motto: motto, avatar: avatar}}}, where:{slug: slug}}), TEAMS_FRAGMENT)
return ctx.db.mutation.updateTeam({data:{profile: {update: {description: description, motto: motto, avatar: avatar}}}, where:{slug: slug}}, TEAMS_FRAGMENT)
.catch((err) => {
console.log('createTeam error: ', err)
return err
})
},
async deleteTeam(parent, { id }, ctx, info) {
return ctx.db.mutation.deleteTeam({ where: { id } }, info)
async deleteTeam(parent, { slug }, ctx, info) {
return ctx.db.mutation.deleteTeam({ where: { slug } }, info)
.catch((res) => {
console.log('deleteTeam error: ', res)
const errors = res.graphQLErrors.map((error) => {
+1 -1
View File
@@ -20,7 +20,7 @@ type Mutation {
authenticate(idToken: String!): Member
createTeam(name: String!, slug: String!, owner: String!): Team @isAuthenticated
updateTeamProfile(slug: String!, owner: String!, description: String, motto: String, avatar: String): Team @isAuthenticated
deleteTeam(id: ID!): Team @isAuthenticated @isOwner(type: "Team")
deleteTeam(slug: String!): Team @isAuthenticated @isOwner(type: "Team")
}
input MemberProfileInput {