File tree Expand file tree Collapse file tree 5 files changed +11
-11
lines changed
packages/plugins/users-permissions/server Expand file tree Collapse file tree 5 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -21,10 +21,10 @@ module.exports = {
2121 ctx . send ( { ok : true } ) ;
2222 } ,
2323
24- async getRole ( ctx ) {
24+ async findOne ( ctx ) {
2525 const { id } = ctx . params ;
2626
27- const role = await getService ( 'role' ) . getRole ( id ) ;
27+ const role = await getService ( 'role' ) . findOne ( id ) ;
2828
2929 if ( ! role ) {
3030 return ctx . notFound ( ) ;
@@ -33,8 +33,8 @@ module.exports = {
3333 ctx . send ( { role } ) ;
3434 } ,
3535
36- async getRoles ( ctx ) {
37- const roles = await getService ( 'role' ) . getRoles ( ) ;
36+ async find ( ctx ) {
37+ const roles = await getService ( 'role' ) . find ( ) ;
3838
3939 ctx . send ( { roles } ) ;
4040 } ,
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ module.exports = {
3737 . store ( { type : 'plugin' , name : 'users-permissions' , key : 'advanced' } )
3838 . get ( ) ;
3939
40- const roles = await getService ( 'role' ) . getRoles ( ) ;
40+ const roles = await getService ( 'role' ) . find ( ) ;
4141
4242 ctx . send ( { settings, roles } ) ;
4343 } ,
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ module.exports = [
44 {
55 method : 'GET' ,
66 path : '/roles/:id' ,
7- handler : 'role.getRole ' ,
7+ handler : 'role.findOne ' ,
88 config : {
99 policies : [
1010 {
@@ -19,7 +19,7 @@ module.exports = [
1919 {
2020 method : 'GET' ,
2121 path : '/roles' ,
22- handler : 'role.getRoles ' ,
22+ handler : 'role.find ' ,
2323 config : {
2424 policies : [
2525 {
Original file line number Diff line number Diff line change @@ -4,12 +4,12 @@ module.exports = [
44 {
55 method : 'GET' ,
66 path : '/roles/:id' ,
7- handler : 'role.getRole ' ,
7+ handler : 'role.findOne ' ,
88 } ,
99 {
1010 method : 'GET' ,
1111 path : '/roles' ,
12- handler : 'role.getRoles ' ,
12+ handler : 'role.find ' ,
1313 } ,
1414 {
1515 method : 'POST' ,
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ module.exports = ({ strapi }) => ({
4141 await Promise . all ( createPromises ) ;
4242 } ,
4343
44- async getRole ( roleID ) {
44+ async findOne ( roleID ) {
4545 const role = await strapi
4646 . query ( 'plugin::users-permissions.role' )
4747 . findOne ( { where : { id : roleID } , populate : [ 'permissions' ] } ) ;
@@ -68,7 +68,7 @@ module.exports = ({ strapi }) => ({
6868 } ;
6969 } ,
7070
71- async getRoles ( ) {
71+ async find ( ) {
7272 const roles = await strapi . query ( 'plugin::users-permissions.role' ) . findMany ( { sort : [ 'name' ] } ) ;
7373
7474 for ( const role of roles ) {
You can’t perform that action at this time.
0 commit comments