mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-12 23:31:02 +00:00
013aa3954d
The first time an admin opens the settings on an installation that can share, a dialog asks for the whole installation, with every field switched on and a plain list of what never goes along. Nothing is sent before Agree; Not now asks again in 14 days, No keeps the question away until the terms change, and closing it decides nothing. Inside the TREK Places API card, Share place details then holds the switch for the installation and one per field, the figures of the last 30 days, the transmission log and the way to withdraw everything sent. The place form reports for each field whether the user typed it or a provider filled it.
15 lines
855 B
TypeScript
15 lines
855 B
TypeScript
import type { PlaceContribDecisionRequest, PlaceContribLogQuery } from '@trek/shared';
|
|
import apiClient from './client';
|
|
|
|
/** /api/admin/places-contribute: sharing place details with the TREK Places API. Admin only. */
|
|
export const placeContribApi = {
|
|
state: (signal?: AbortSignal): Promise<unknown> =>
|
|
apiClient.get('/admin/places-contribute', { signal }).then((r) => r.data),
|
|
decide: (body: PlaceContribDecisionRequest): Promise<unknown> =>
|
|
apiClient.put('/admin/places-contribute/decision', body).then((r) => r.data),
|
|
log: (query: Partial<PlaceContribLogQuery>, signal?: AbortSignal): Promise<unknown> =>
|
|
apiClient.get('/admin/places-contribute/log', { params: query, signal }).then((r) => r.data),
|
|
withdraw: (): Promise<unknown> =>
|
|
apiClient.post('/admin/places-contribute/withdraw', { confirm: true }).then((r) => r.data),
|
|
};
|