Add region code support

This commit is contained in:
2026-10-06 15:15:04 +05:30
parent c52ecfdebc
commit b75cd01e90
4 changed files with 105 additions and 46 deletions
+4
View File
@@ -84,6 +84,7 @@ export interface PageParams {
export interface RegionBody {
name: string
code?: string
isActive?: boolean
}
@@ -91,6 +92,9 @@ export const regions = {
list: (params?: PageParams) =>
api.get<PaginatedResponse<RegionResponse>>('/regions', { params }).then(r => r.data),
nextCode: () =>
api.get<{ code: string }>('/regions/next-code').then(r => r.data),
get: (id: string) =>
api.get<RegionResponse>(`/regions/${id}`).then(r => r.data),