draft
This commit is contained in:
25
frontend/src/api/merchant.ts
Normal file
25
frontend/src/api/merchant.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import client from './client'
|
||||
import type { Merchant, MerchantApplication, MerchantStatus } from '../types'
|
||||
|
||||
export const merchantApi = {
|
||||
list: (params: { status?: MerchantStatus; limit?: number; offset?: number }) =>
|
||||
client.get<{ data: { list: Merchant[] } }>('/admin/merchant', { params }),
|
||||
|
||||
get: (merchantID: string) =>
|
||||
client.get<{ data: Merchant }>(`/admin/merchant/${merchantID}`),
|
||||
|
||||
create: (data: Partial<Merchant>) =>
|
||||
client.post<{ data: Merchant }>('/admin/merchant', data),
|
||||
|
||||
freeze: (merchantID: string) =>
|
||||
client.post(`/admin/merchant/${merchantID}/freeze`),
|
||||
|
||||
unfreeze: (merchantID: string) =>
|
||||
client.post(`/admin/merchant/${merchantID}/unfreeze`),
|
||||
|
||||
apply: (merchantID: string, data: { channel_code: string; submit_data?: Record<string, unknown> }) =>
|
||||
client.post<{ data: { application_id: string } }>(`/admin/merchant/${merchantID}/apply`, data),
|
||||
|
||||
auditStatus: (merchantID: string) =>
|
||||
client.get<{ data: MerchantApplication }>(`/admin/merchant/${merchantID}/audit`),
|
||||
}
|
||||
Reference in New Issue
Block a user