🐛 fix: update API prefix handling to ensure compatibility with undefined VITE_API_PREFIX

This commit is contained in:
web
2025-12-12 09:11:42 -08:00
parent 6a70eab2e9
commit 3920c6ff59
29 changed files with 311 additions and 251 deletions
+3 -3
View File
@@ -7,7 +7,7 @@ export async function createOrder(
options?: { [key: string]: any }
) {
return request<API.Response & { data?: any }>(
`${import.meta.env.VITE_API_PREFIX}/v1/admin/order/`,
`${import.meta.env.VITE_API_PREFIX || ""}/v1/admin/order/`,
{
method: "POST",
headers: {
@@ -26,7 +26,7 @@ export async function getOrderList(
options?: { [key: string]: any }
) {
return request<API.Response & { data?: API.GetOrderListResponse }>(
`${import.meta.env.VITE_API_PREFIX}/v1/admin/order/list`,
`${import.meta.env.VITE_API_PREFIX || ""}/v1/admin/order/list`,
{
method: "GET",
params: {
@@ -43,7 +43,7 @@ export async function updateOrderStatus(
options?: { [key: string]: any }
) {
return request<API.Response & { data?: any }>(
`${import.meta.env.VITE_API_PREFIX}/v1/admin/order/status`,
`${import.meta.env.VITE_API_PREFIX || ""}/v1/admin/order/status`,
{
method: "PUT",
headers: {