feat: admin - groups edit UI
This commit is contained in:
@@ -48,19 +48,21 @@ module.exports = {
|
||||
const group = await WIKI.db.Group.create({
|
||||
name: args.name
|
||||
})
|
||||
console.info(group)
|
||||
return {
|
||||
responseResult: graphHelper.generateSuccess('Group created successfully.'),
|
||||
group
|
||||
}
|
||||
},
|
||||
delete(obj, args) {
|
||||
return WIKI.db.Group.destroy({
|
||||
async delete(obj, args) {
|
||||
await WIKI.db.Group.destroy({
|
||||
where: {
|
||||
id: args.id
|
||||
},
|
||||
limit: 1
|
||||
})
|
||||
return {
|
||||
responseResult: graphHelper.generateSuccess('Group has been deleted.')
|
||||
}
|
||||
},
|
||||
unassignUser(obj, args) {
|
||||
return WIKI.db.Group.findById(args.groupId).then(grp => {
|
||||
|
@@ -18,7 +18,11 @@ type GroupQuery {
|
||||
list(
|
||||
filter: String
|
||||
orderBy: String
|
||||
): [Group]
|
||||
): [GroupMinimal]
|
||||
|
||||
single(
|
||||
id: String!
|
||||
): Group
|
||||
}
|
||||
|
||||
# -----------------------------------------------
|
||||
@@ -59,12 +63,19 @@ type GroupResponse {
|
||||
group: Group
|
||||
}
|
||||
|
||||
type GroupMinimal {
|
||||
id: Int!
|
||||
name: String!
|
||||
userCount: Int
|
||||
createdAt: Date!
|
||||
updatedAt: Date!
|
||||
}
|
||||
|
||||
type Group {
|
||||
id: Int!
|
||||
name: String!
|
||||
rights: [String]
|
||||
users: [User]
|
||||
userCount: Int
|
||||
createdAt: Date!
|
||||
updatedAt: Date!
|
||||
}
|
||||
|
Reference in New Issue
Block a user