- Debian-based api image (bookworm-slim), docker/debian mirrors, prisma binaryTargets for openssl 3.0 - nginx: admin SPA under /admin, TLS via acme.sh (ZeroSSL) + auto-renewal cron, http->https redirect - prisma: add origin_goods.delisted migration, sync missing schema (good_image/tag_font_color/good_tags), fix users.createdAt Timestamptz - api: CORS wildcard reflection, helmet CORP cross-origin, price backfill in persistProductDetail, categoryIcon ancestor fallback, mediaByColor per-color gallery in public goods detail - admin: /admin base path (vite + router) - import-data.mjs: udt_name casting, serial sequence advance fix
29 lines
770 B
TypeScript
29 lines
770 B
TypeScript
import request from './request'
|
|
import type { SyncLog } from '@/types'
|
|
|
|
export const syncApi = {
|
|
syncProducts: () => {
|
|
return request.post<any, { message: string }>('/sync/products')
|
|
},
|
|
|
|
syncCategories: () => {
|
|
return request.post<any, { message: string }>('/sync/categories')
|
|
},
|
|
|
|
syncProductDetails: () => {
|
|
return request.post<any, { message: string }>('/sync/product-details')
|
|
},
|
|
|
|
syncOneProductDetail: (goodId: string) => {
|
|
return request.post<any, { goodId: string; variants: number; detailSyncedAt: string }>(
|
|
`/sync/products/${goodId}/detail`,
|
|
)
|
|
},
|
|
|
|
getSyncStatus: (limit?: number) => {
|
|
return request.get<any, SyncLog[]>('/sync/status', {
|
|
params: limit ? { limit } : undefined,
|
|
})
|
|
},
|
|
}
|