1
0
mirror of https://github.com/sasjs/server.git synced 2026-01-08 15:00:05 +00:00

feat: replace ID with UID

BREAKING CHANGE: remove auto incremental ids from user, group and permissions and add a virtual uid property that returns string value of documents object id
This commit is contained in:
2023-05-09 15:01:56 +05:00
parent d2239f75c2
commit 093fe90589
36 changed files with 461 additions and 483 deletions

View File

@@ -2,8 +2,9 @@ import express from 'express'
import { Request, Security, Route, Tags, Example, Get } from 'tsoa'
import { UserResponse } from './user'
interface SessionResponse extends UserResponse {
needsToUpdatePassword: boolean
interface SessionResponse extends Omit<UserResponse, 'uid'> {
id: string
needsToUpdatePassword?: boolean
}
@Security('bearerAuth')
@@ -14,11 +15,12 @@ export class SessionController {
* @summary Get session info (username).
*
*/
@Example<UserResponse>({
id: 123,
@Example<SessionResponse>({
id: 'userIdString',
username: 'johnusername',
displayName: 'John',
isAdmin: false
isAdmin: false,
needsToUpdatePassword: false
})
@Get('/')
public async session(