🐛 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 updatePaymentMethod(
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.Response & { data?: API.PaymentConfig }>(
|
||||
`${import.meta.env.VITE_API_PREFIX}/v1/admin/payment/`,
|
||||
`${import.meta.env.VITE_API_PREFIX || ""}/v1/admin/payment/`,
|
||||
{
|
||||
method: "PUT",
|
||||
headers: {
|
||||
@@ -25,7 +25,7 @@ export async function createPaymentMethod(
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.Response & { data?: API.PaymentConfig }>(
|
||||
`${import.meta.env.VITE_API_PREFIX}/v1/admin/payment/`,
|
||||
`${import.meta.env.VITE_API_PREFIX || ""}/v1/admin/payment/`,
|
||||
{
|
||||
method: "POST",
|
||||
headers: {
|
||||
@@ -43,7 +43,7 @@ export async function deletePaymentMethod(
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.Response & { data?: any }>(
|
||||
`${import.meta.env.VITE_API_PREFIX}/v1/admin/payment/`,
|
||||
`${import.meta.env.VITE_API_PREFIX || ""}/v1/admin/payment/`,
|
||||
{
|
||||
method: "DELETE",
|
||||
headers: {
|
||||
@@ -62,7 +62,7 @@ export async function getPaymentMethodList(
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.Response & { data?: API.GetPaymentMethodListResponse }>(
|
||||
`${import.meta.env.VITE_API_PREFIX}/v1/admin/payment/list`,
|
||||
`${import.meta.env.VITE_API_PREFIX || ""}/v1/admin/payment/list`,
|
||||
{
|
||||
method: "GET",
|
||||
params: {
|
||||
@@ -76,7 +76,7 @@ export async function getPaymentMethodList(
|
||||
/** Get supported payment platform GET /v1/admin/payment/platform */
|
||||
export async function getPaymentPlatform(options?: { [key: string]: any }) {
|
||||
return request<API.Response & { data?: API.PlatformResponse }>(
|
||||
`${import.meta.env.VITE_API_PREFIX}/v1/admin/payment/platform`,
|
||||
`${import.meta.env.VITE_API_PREFIX || ""}/v1/admin/payment/platform`,
|
||||
{
|
||||
method: "GET",
|
||||
...(options || {}),
|
||||
|
||||
Reference in New Issue
Block a user