Skip to content

Commit f2b7813

Browse files
authored
[#60] ✨ 백엔드 업데이트에 따른 타입 추가 (#123)
* [#60] 🔧 update scripts since src directory * [#60] ✨ update apiSchema.ts along to an api update from backend * [#60] ♻️ update global type + api response types * [#60] 🚚 rename apiScheme.ts into apiSchema.d.ts * [#60] ✨ add common post types * [#60] ✨ update team types * [#60] ♻️ refactor team related interfaces * [#60] ✨ update community related types * [#60] ✨ update auth related types * [#60] 🚚 update type generating scripts * [#60] 🚚 rename api schema file * [#60] ✨ add portfolio type * [#60] ✨ add profile type * [#60] 💄 format and organize prior types * [#60] ✨ add new types along to backend update
1 parent dfbbe17 commit f2b7813

File tree

11 files changed

+3154
-995
lines changed

11 files changed

+3154
-995
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
"format": "prettier --write .",
6868
"test": "jest",
6969
"commit": "cz",
70-
"generate:types": "openapi-typescript http://43.202.50.174:8080/v3/api-docs --output types/apiSchema.ts",
70+
"generate:types": "openapi-typescript http://43.202.50.174:8080/v3/api-docs --output src/types/apiSchema.types.d.ts",
7171
"storybook": "storybook dev -p 6006",
7272
"build-storybook": "storybook build",
7373
"chromatic": "npx chromatic"

src/types/apiResponse.types.d.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
interface ApiResponse<T = unknown> {
2-
isSuccess: SuccessResponse
3-
code: StatusCode
4-
message: Message
5-
result?: T
2+
isSuccess: boolean // 요청 성공 여부
3+
code: string // 응답 코드 (예: TEAM004)
4+
message: string // 응답 메시지 (예: "This is a deleted post.")
5+
result?: T // 응답 데이터 (제네릭 타입)
66
}
7-
type ApiResponseObject = ApiResponse<Record<string, never>>
8-
type ApiResponseString = ApiResponse<string>

0 commit comments

Comments
 (0)