mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-29 16:10:07 +00:00
admin: ask once, then show and steer what is shared of place details
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.
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
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),
|
||||
};
|
||||
Reference in New Issue
Block a user