Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Register
Sign in
Toggle navigation
Menu
UPSMF
user-service
Commits
fc6a38e0
Unverified
Commit
fc6a38e0
authored
2 years ago
by
radhay-samagra
Committed by
GitHub
2 years ago
Browse files
Options
Download
Plain Diff
Merge pull request #27 from Samarth-HP/develop
Added School as a role for admin api
parents
80985c29
16fa6165
master
v2.4.4
v2.4.3
v2.4.2
v2.4.1
v2.4.0
v2.3.9
v2.3.8
v2.3.7
v2.3.6
v2.3.5
v2.3.4
v2.3.3.1
v2.3.3
v2.3.2
v2.3.1
v2.3.0
v2.2.0
v2.1.7
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/admin/admin.controller.ts
+6
-6
src/admin/admin.controller.ts
with
6 additions
and
6 deletions
+6
-6
src/admin/admin.controller.ts
+
6
−
6
View file @
fc6a38e0
...
...
@@ -13,7 +13,7 @@ export class AdminController {
)
{}
@
Post
(
'
/all
'
)
@
Roles
(
'
Admin
'
)
@
Roles
(
'
Admin
'
,
'
school
'
)
@
UseGuards
(
JwtAuthGuard
)
async
fetchUsers
(@
Request
()
req
,
@
Body
()
data
:
any
):
Promise
<
UsersResponse
>
{
const
users
:
UsersResponse
=
await
this
.
adminService
.
fetchUsers
(
data
);
...
...
@@ -21,7 +21,7 @@ export class AdminController {
}
@
Post
(
'
/changePassword
'
)
@
Roles
(
'
Admin
'
)
@
Roles
(
'
Admin
'
,
'
school
'
)
@
UseGuards
(
JwtAuthGuard
)
async
updatePassword
(@
Body
()
data
:
{
loginId
:
string
,
password
:
string
}):
Promise
<
SignupResponse
>
{
const
status
:
SignupResponse
=
await
this
.
adminService
.
updatePassword
(
data
);
...
...
@@ -29,7 +29,7 @@ export class AdminController {
}
@
Post
(
'
/createUser
'
)
@
Roles
(
'
Admin
'
)
@
Roles
(
'
Admin
'
,
'
school
'
)
@
UseGuards
(
JwtAuthGuard
)
async
createUser
(@
Body
()
data
:
UserRegistration
):
Promise
<
SignupResponse
>
{
const
users
:
SignupResponse
=
await
this
.
adminService
.
createUser
(
data
);
...
...
@@ -37,7 +37,7 @@ export class AdminController {
}
@
Patch
(
'
/updateUser/:userId
'
)
@
Roles
(
'
Admin
'
)
@
Roles
(
'
Admin
'
,
'
school
'
)
@
UseGuards
(
JwtAuthGuard
)
async
updateUser
(@
Param
(
'
userId
'
)
userId
:
string
,
@
Body
()
data
:
User
):
Promise
<
SignupResponse
>
{
const
user
:
SignupResponse
=
await
this
.
adminService
.
updateUser
(
userId
,
data
);
...
...
@@ -45,7 +45,7 @@ export class AdminController {
}
@
Get
(
'
/searchUser
'
)
@
Roles
(
'
Admin
'
)
@
Roles
(
'
Admin
'
,
'
school
'
)
@
UseGuards
(
JwtAuthGuard
)
async
searchUser
(@
Query
()
query
:
{
queryString
:
string
,
startRow
:
number
,
numberOfResults
:
number
}):
Promise
<
UsersResponse
>
{
console
.
log
(
query
.
numberOfResults
)
...
...
@@ -54,7 +54,7 @@ export class AdminController {
}
@
Get
(
'
/user/:userId
'
)
@
Roles
(
'
Admin
'
)
@
Roles
(
'
Admin
'
,
'
school
'
)
@
UseGuards
(
JwtAuthGuard
)
async
searchUserbyId
(@
Param
(
'
userId
'
)
userId
:
string
):
Promise
<
UsersResponse
>
{
const
users
:
UsersResponse
=
await
this
.
adminService
.
fetchUsersByString
(
userId
,
undefined
,
undefined
);
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets