Skip to content

Commit 59d20b2

Browse files
committed
[#60] ♻️ update global type + api response types
1 parent f147c6b commit 59d20b2

File tree

2 files changed

+18
-7
lines changed

2 files changed

+18
-7
lines changed

src/types/apiResponse.types.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
interface ApiResponse<T = unknown> {
2-
isSuccess: SuccessResponse
3-
code: StatusCode
4-
message: Message
2+
isSuccess: boolean
3+
code: string // 예시) TEAM004
4+
message: string // 예시) "This is a deleted post."
55
result?: T
66
}
77
type ApiResponseObject = ApiResponse<Record<string, never>>

src/types/global.types.d.ts

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,32 @@
1+
// 기본 타입 정의
12
type Id = number
2-
type TechStack = string
3-
type SuccessResponse = boolean
4-
type StatusCode = string
5-
type Message = string
63
type URL = string
74
type Token = string
85

6+
// 사용자 관련 타입
97
type Email = string
108
type Password = string
119
type Name = string
1210
type Nickname = string
1311
type GitHub = string
1412

13+
// 공통 속성 타입
14+
type TechStack = string
15+
16+
// 타임스탬프 정의
17+
type TimeStamps = {
18+
// Format: date-time
19+
createdAt: string
20+
updatedAt?: string // 있을 수도 있고 없을 수도 있음
21+
}
22+
23+
// 사용자 관련 인터페이스
1524
interface User {
1625
id: Id
1726
email: Email
1827
name: Name
1928
nickname: Nickname
2029
imageUrl: URL
2130
}
31+
32+
type MemberInfo = Omit<User, 'email' | 'name'>

0 commit comments

Comments
 (0)