🐛 fix: update API prefix handling to ensure compatibility with undefined VITE_API_PREFIX
This commit is contained in:
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user