Pierre Noël 1c65d3c10a add GET /roles/:id
Signed-off-by: Pierre Noël <petersg83@gmail.com>
2020-07-08 10:46:11 +02:00

17 lines
272 B
JavaScript

'use strict';
module.exports = {
async findOne(ctx) {
const { id } = ctx.params;
const role = await strapi.admin.services.role.fetch({ id });
if (!role) {
return ctx.notFound('role.notFound');
}
ctx.body = {
data: role,
};
},
};