feat: make spatial entry optional and authoritative
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { apiGet, apiPost, apiPatch } from './client'
|
||||
import type { AreaCreate, AreaListResponse, AreaRead } from '../../types'
|
||||
import type { AreaCreate, AreaListResponse, AreaRead, MunicipalitySearchResponse } from '../../types'
|
||||
|
||||
const AREA_PAGE_SIZE = 200
|
||||
|
||||
@@ -36,4 +36,8 @@ export const areasApi = {
|
||||
apiGet<AreaRead>(`/api/v1/projects/${projectId}/areas/${areaId}`),
|
||||
update: (projectId: string, areaId: string, payload: Partial<AreaCreate>): Promise<AreaRead> =>
|
||||
apiPatch<AreaRead>(`/api/v1/projects/${projectId}/areas/${areaId}`, payload),
|
||||
searchMunicipalities: (projectId: string, query: string): Promise<MunicipalitySearchResponse> =>
|
||||
apiGet<MunicipalitySearchResponse>(`/api/v1/projects/${projectId}/areas/municipalities?query=${encodeURIComponent(query)}&limit=12`),
|
||||
activateMunicipality: (projectId: string, niscode: string): Promise<AreaRead> =>
|
||||
apiPost<AreaRead>(`/api/v1/projects/${projectId}/areas/municipalities/${encodeURIComponent(niscode)}/activate`, {}),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user