mirror of
https://github.com/strapi/strapi.git
synced 2025-07-19 15:06:11 +00:00
17 lines
272 B
JavaScript
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,
|
||
|
};
|
||
|
},
|
||
|
};
|