Initial GeoIntel V1 foundation
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
import { apiGet, apiPost, apiPatch } from './client'
|
||||
import type { AreaCreate, AreaListResponse, AreaRead } from '../../types'
|
||||
|
||||
export const areasApi = {
|
||||
list: (projectId: string): Promise<AreaListResponse> => apiGet<AreaListResponse>(`/api/v1/projects/${projectId}/areas`),
|
||||
create: (projectId: string, payload: AreaCreate): Promise<AreaRead> =>
|
||||
apiPost<AreaRead>(`/api/v1/projects/${projectId}/areas`, payload),
|
||||
get: (projectId: string, areaId: string): Promise<AreaRead> =>
|
||||
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),
|
||||
}
|
||||
Reference in New Issue
Block a user