Skip to content

Commit 933dbe7

Browse files
committedOct 10, 2023
fix: duplicated types folder and moved it to backend
1 parent 9ed3d0a commit 933dbe7

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed
 

‎packages/nest-backend/@types/api.d.ts

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
}

‎packages/nest-backend/src/app.service.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Injectable } from '@nestjs/common'
2-
import { Room, User } from '../../@types/api'
2+
import type { Room, User } from '../@types/api'
33

44
export interface ServerRoom extends Room {
55
users: Map<string, ServerUser>

‎packages/nest-backend/src/utils.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { ServerRoom, ServerUser } from './app.service'
2-
import { Role } from '../../@types/api'
2+
3+
const ROLE_ADMIN = 'admin'
34

45
export function createUser(id: string): ServerUser {
56
return {
@@ -30,5 +31,5 @@ export function areEstimationsComplete(room: ServerRoom): boolean {
3031
}
3132

3233
export function isAdmin(user: ServerUser): boolean {
33-
return user.roles.includes(Role.ADMIN)
34+
return user.roles.includes(ROLE_ADMIN)
3435
}

1 commit comments

Comments
 (1)

vercel[bot] commented on Oct 10, 2023

@vercel[bot]

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

Please sign in to comment.