251210_01_ENH : 프로젝트 수정, 에디터 구현중

This commit is contained in:
2025-12-10 16:24:49 +09:00
parent dd8723861a
commit ef949a6242
57 changed files with 4459 additions and 1247 deletions

View File

@@ -1,7 +1,7 @@
import {NextResponse} from "next/server";
import {HttpError} from "@/lib/http-client";
import {clientEnv} from "@/lib/env.client";
import commonConst from "@/config/commonConst";
import {NONE_HTTP_ERROR, UNKNOWN_HTTP_ERROR} from "@/const/commonConst";
export type ApiError = {
status: number
@@ -26,7 +26,7 @@ const isDev = clientEnv.ENV !== "prod"
export const apiError = (e: unknown): ApiError => {
if (e instanceof HttpError) {
const d = e.data as any
const code = typeof d?.code === "string" ? d.code : commonConst.unknownHttpError
const code = typeof d?.code === "string" ? d.code : UNKNOWN_HTTP_ERROR
const message =
(typeof d?.detail === "string" && d.detail) ||
(typeof d?.message === "string" && d.message) ||
@@ -48,5 +48,5 @@ export const apiError = (e: unknown): ApiError => {
}
if (isDev) console.error("[NON-HTTP ERROR]", e)
return { status: 500, code: commonConst.noneHttpError, message: "저장에 실패했습니다." }
return { status: 500, code: NONE_HTTP_ERROR, message: "저장에 실패했습니다." }
}