mirror of
https://github.com/strapi/strapi.git
synced 2025-07-28 03:20:17 +00:00
26 lines
497 B
JavaScript
26 lines
497 B
JavaScript
'use strict';
|
|
|
|
module.exports = ({ nexus, strapi }) => {
|
|
const { nonNull } = nexus;
|
|
|
|
return {
|
|
type: 'UsersPermissionsDeleteRolePayload',
|
|
|
|
args: {
|
|
id: nonNull('ID'),
|
|
},
|
|
|
|
description: 'Delete an existing role',
|
|
|
|
async resolve(parent, args, context) {
|
|
const { koaContext } = context;
|
|
|
|
koaContext.params = { role: args.id };
|
|
|
|
await strapi.plugin('users-permissions').controller('role').deleteRole(koaContext);
|
|
|
|
return { ok: true };
|
|
},
|
|
};
|
|
};
|