1
0
mirror of https://github.com/sasjs/server.git synced 2026-07-23 21:25:29 +00:00

chore: add isAdmin field in user response

This commit is contained in:
2022-06-26 01:48:31 +05:00
parent 35439d7d51
commit 4ddfec0403
6 changed files with 47 additions and 43 deletions
+2 -6
View File
@@ -2,10 +2,6 @@ import express from 'express'
import { Request, Security, Route, Tags, Example, Get } from 'tsoa'
import { UserResponse } from './user'
interface SessionResponse extends UserResponse {
isAdmin: boolean
}
@Security('bearerAuth')
@Route('SASjsApi/session')
@Tags('Session')
@@ -14,7 +10,7 @@ export class SessionController {
* @summary Get session info (username).
*
*/
@Example<SessionResponse>({
@Example<UserResponse>({
id: 123,
username: 'johnusername',
displayName: 'John',
@@ -23,7 +19,7 @@ export class SessionController {
@Get('/')
public async session(
@Request() request: express.Request
): Promise<SessionResponse> {
): Promise<UserResponse> {
return session(request)
}
}