- 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
35 lines
900 B
TypeScript
35 lines
900 B
TypeScript
import request from './request'
|
|
import type {
|
|
Country,
|
|
CreateCountryRequest,
|
|
UpdateCountryRequest,
|
|
CountryFilter,
|
|
PaginatedResult,
|
|
} from '@/types'
|
|
|
|
export const countriesApi = {
|
|
// Get countries list
|
|
getCountriesList: (params: CountryFilter) => {
|
|
return request.get<any, PaginatedResult<Country>>('/countries', { params })
|
|
},
|
|
|
|
// Get country by id
|
|
getCountryById: (id: string) => {
|
|
return request.get<any, Country>(`/countries/${id}`)
|
|
},
|
|
|
|
// Create country
|
|
createCountry: (data: CreateCountryRequest) => {
|
|
return request.post<any, Country>('/countries', data)
|
|
},
|
|
|
|
// Update country
|
|
updateCountry: (id: string, data: UpdateCountryRequest) => {
|
|
return request.patch<any, Country>(`/countries/${id}`, data)
|
|
},
|
|
|
|
// Delete country
|
|
deleteCountry: (id: string) => {
|
|
return request.delete(`/countries/${id}`)
|
|
},
|
|
} |