mirror of
https://github.com/strapi/strapi.git
synced 2025-07-31 04:45:54 +00:00
29 lines
524 B
JavaScript
29 lines
524 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 };
|
||
|
},
|
||
|
};
|
||
|
};
|