右键删除节点列表,好像实现了,还需要实现右键删除地图节点
This commit is contained in:
@@ -49,6 +49,10 @@ function putJSON<T>(path: string, body?: unknown): Promise<T> {
|
||||
})
|
||||
}
|
||||
|
||||
function deleteJSON<T>(path: string): Promise<T> {
|
||||
return requestJSON<T>(path, { method: 'DELETE' })
|
||||
}
|
||||
|
||||
export function getHealth(): Promise<HealthStatus> {
|
||||
return getJSON<HealthStatus>('/api/health')
|
||||
}
|
||||
@@ -65,6 +69,14 @@ export function getTextMessages(limit = 100, offset = 0): Promise<ListResponse<T
|
||||
return getJSON<ListResponse<TextMessage>>(`/api/text-messages?limit=${limit}&offset=${offset}`)
|
||||
}
|
||||
|
||||
export function deleteTextMessage(id: number): Promise<{ status: string }> {
|
||||
return deleteJSON<{ status: string }>(`/api/admin/text-messages/${id}`)
|
||||
}
|
||||
|
||||
export function deleteNode(nodeId: string): Promise<{ status: string }> {
|
||||
return deleteJSON<{ status: string }>(`/api/admin/nodes/${encodeURIComponent(nodeId)}`)
|
||||
}
|
||||
|
||||
export function getPositions(limit = 500): Promise<ListResponse<PositionRecord>> {
|
||||
return getJSON<ListResponse<PositionRecord>>(`/api/positions?limit=${limit}`)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user