fix(accounting): use useAxios in Shayegan API client
Match zarin/tahesab HTTP helper so Vite can resolve the module. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+38
-12
@@ -1,17 +1,43 @@
|
||||
import request from '@/utils/http'
|
||||
import useAxios from '@core/utils/useAxios'
|
||||
|
||||
export function shayeganHealth() {
|
||||
return request.get({ url: '/admin/shayegan/health' })
|
||||
export interface ShayeganRecord {
|
||||
id?: number | null
|
||||
customer_id?: number | null
|
||||
order_id?: number | null
|
||||
withdraw_id?: number | null
|
||||
amount?: number | null
|
||||
desc?: string | null
|
||||
type?: string | null
|
||||
sync_status?: 'pending' | 'success' | 'failed' | 'timeout' | string
|
||||
sync_log?: string | null
|
||||
shayegan_number?: string | null
|
||||
shayegan_guid?: string | null
|
||||
endpoint?: string | null
|
||||
created_at?: string | null
|
||||
}
|
||||
|
||||
export function shayeganTable(data: Record<string, unknown>) {
|
||||
return request.post({ url: '/admin/shayegan/table', data })
|
||||
}
|
||||
export const shayeganHealth = async () =>
|
||||
await useAxios.get<{
|
||||
ok: boolean
|
||||
message?: string
|
||||
http_status?: number | null
|
||||
timeout?: boolean
|
||||
body?: unknown
|
||||
}>('/admin/shayegan/health')
|
||||
|
||||
export function shayeganShow(id: number | string) {
|
||||
return request.get({ url: `/admin/shayegan/${id}` })
|
||||
}
|
||||
export const shayeganTable = async (params: Record<string, unknown>) =>
|
||||
await useAxios.post<{
|
||||
data: ShayeganRecord[]
|
||||
total: number
|
||||
current_page?: number
|
||||
per_page?: number
|
||||
}>('/admin/shayegan/table', params)
|
||||
|
||||
export function shayeganRetry(id: number | string, force = false) {
|
||||
return request.post({ url: `/admin/shayegan/${id}/retry`, data: { force } })
|
||||
}
|
||||
export const shayeganShow = async (id: number | string) =>
|
||||
await useAxios.get<ShayeganRecord>(`/admin/shayegan/${id}`)
|
||||
|
||||
export const shayeganRetry = async (id: number | string, force = false) =>
|
||||
await useAxios.post<{ ok: boolean; message?: string; row?: ShayeganRecord }>(
|
||||
`/admin/shayegan/${id}/retry`,
|
||||
{ force }
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user