|
|
@ -148,12 +148,13 @@ export const destroy = async (ctx: any) => { |
|
|
|
|
|
|
|
|
export const bulkDelete = async (ctx: any) => { |
|
|
export const bulkDelete = async (ctx: any) => { |
|
|
const { userIds } = ctx.request.body |
|
|
const { userIds } = ctx.request.body |
|
|
|
|
|
|
|
|
let deleted = 0 |
|
|
let deleted = 0 |
|
|
userIds.forEach(async (id: any) => { |
|
|
|
|
|
|
|
|
for (const id of userIds) { |
|
|
await users.destroy(id, ctx.user) |
|
|
await users.destroy(id, ctx.user) |
|
|
deleted++ |
|
|
deleted++ |
|
|
}) |
|
|
} |
|
|
|
|
|
|
|
|
ctx.body = { |
|
|
ctx.body = { |
|
|
message: `${deleted} user(s) deleted`, |
|
|
message: `${deleted} user(s) deleted`, |
|
|
} |
|
|
} |
|
|
|