mirror of
https://git.meshkee.com/Meshkee/dashboards.git
synced 2026-08-11 22:30:58 +04:30
Improve product cards/pagination, Farsi locale fonts, and super-admin migrate UI.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
2e40d5eb4c
commit
f5b2193ba1
@@ -1,5 +1,13 @@
|
||||
import { apiRequest } from '../lib/api'
|
||||
import type { BusinessesListResponse, BusinessListItem, CreateBusinessPayload } from '../types/business'
|
||||
import type {
|
||||
BusinessesListResponse,
|
||||
BusinessListItem,
|
||||
CreateBusinessPayload,
|
||||
MigrateFromOldPayload,
|
||||
MigrateFromOldResponse,
|
||||
PurgeBusinessDataPayload,
|
||||
PurgeBusinessDataResponse,
|
||||
} from '../types/business'
|
||||
|
||||
export interface ListBusinessesParams {
|
||||
page?: number
|
||||
@@ -12,6 +20,7 @@ export interface ListBusinessesParams {
|
||||
export interface UpdateBusinessPayload {
|
||||
name?: string
|
||||
slug?: string
|
||||
oldBusinessId?: number | null
|
||||
}
|
||||
|
||||
export interface AddDomainPayload {
|
||||
@@ -91,12 +100,35 @@ export async function removeBusiness(businessId: string) {
|
||||
})
|
||||
}
|
||||
|
||||
export async function migrateBusinessFromOld(
|
||||
businessId: string,
|
||||
payload: MigrateFromOldPayload,
|
||||
) {
|
||||
return apiRequest<MigrateFromOldResponse>(`/businesses/${businessId}/migrate-from-old`, {
|
||||
method: 'POST',
|
||||
auth: true,
|
||||
body: payload,
|
||||
})
|
||||
}
|
||||
|
||||
export async function purgeBusinessData(
|
||||
businessId: string,
|
||||
payload: PurgeBusinessDataPayload,
|
||||
) {
|
||||
return apiRequest<PurgeBusinessDataResponse>(`/businesses/${businessId}/purge-data`, {
|
||||
method: 'POST',
|
||||
auth: true,
|
||||
body: payload,
|
||||
})
|
||||
}
|
||||
|
||||
export interface BusinessDetail {
|
||||
id: string
|
||||
name: string
|
||||
nameFa: string | null
|
||||
slug: string
|
||||
isActive: boolean
|
||||
oldBusinessId: string | null
|
||||
}
|
||||
|
||||
export async function getBusiness(businessId: string, signal?: AbortSignal) {
|
||||
|
||||
Reference in New Issue
Block a user