File tree 3 files changed +18
-3
lines changed
3 files changed +18
-3
lines changed Original file line number Diff line number Diff line change
1
+ export interface Room {
2
+ name : string
3
+ estimationsVisible : boolean
4
+ estimationValues : string [ ]
5
+ }
6
+
7
+ export interface User {
8
+ id : string
9
+ name : string
10
+ icon ?: string
11
+ estimation : string | null
12
+ room : string | null
13
+ roles : Role [ ]
14
+ }
Original file line number Diff line number Diff line change 1
1
import { Injectable } from '@nestjs/common'
2
- import { Room , User } from '../ ../@types/api'
2
+ import type { Room , User } from '../@types/api'
3
3
4
4
export interface ServerRoom extends Room {
5
5
users : Map < string , ServerUser >
Original file line number Diff line number Diff line change 1
1
import { ServerRoom , ServerUser } from './app.service'
2
- import { Role } from '../../@types/api'
2
+
3
+ const ROLE_ADMIN = 'admin'
3
4
4
5
export function createUser ( id : string ) : ServerUser {
5
6
return {
@@ -30,5 +31,5 @@ export function areEstimationsComplete(room: ServerRoom): boolean {
30
31
}
31
32
32
33
export function isAdmin ( user : ServerUser ) : boolean {
33
- return user . roles . includes ( Role . ADMIN )
34
+ return user . roles . includes ( ROLE_ADMIN )
34
35
}
You can’t perform that action at this time.
1 commit comments
vercel[bot] commentedon Oct 10, 2023
Successfully deployed to the following URLs:
estimate-me-backend – ./packages/nest-backend
estimate-me-backend-git-master-klefix.vercel.app
estimate-me-backend-klefix.vercel.app
estimate-me-backend.vercel.app