Initial commit: Add project files
ci / backend (push) Failing after 12s
ci / frontend (push) Failing after 19s
ci / static (push) Failing after 45s

This commit is contained in:
2026-08-02 05:15:36 +09:00
commit dcd1322d41
636 changed files with 122352 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
import axios from 'axios'
import { ApiProblem, type ProblemDetails } from './problem'
export const api = axios.create({ baseURL: '/api', timeout: 15_000 })
api.interceptors.request.use(config => {
const user = import.meta.env.VITE_DEV_AUTH_USER as string | undefined
const role = import.meta.env.VITE_DEV_AUTH_ROLE as string | undefined
if (import.meta.env.DEV && user && role) {
config.headers['X-KArtSell-User'] = user
config.headers['X-KArtSell-Role'] = role
}
return config
})
api.interceptors.response.use(
response => response,
error => {
const data = error.response?.data as ProblemDetails | undefined
if (data?.status) throw new ApiProblem(data)
throw error
}
)
+16
View File
@@ -0,0 +1,16 @@
export interface ProblemDetails {
type?: string
title: string
status: number
detail?: string
traceId?: string
errors?: Record<string, string[]>
}
export class ApiProblem extends Error {
constructor(public readonly problem: ProblemDetails) {
super(problem.title)
}
get status(): number { return this.problem.status }
}