From cfda2aa8dc125e32441278658dbaff0c9ad4ad3e Mon Sep 17 00:00:00 2001 From: Andrei Kuchuk Date: Sun, 28 Jul 2024 13:43:21 +0400 Subject: [PATCH] #151 update preview events endpoint --- src/shared/lib/io/use-events-requests.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/shared/lib/io/use-events-requests.ts b/src/shared/lib/io/use-events-requests.ts index 0f3b1dd9..fd8f1b26 100644 --- a/src/shared/lib/io/use-events-requests.ts +++ b/src/shared/lib/io/use-events-requests.ts @@ -21,9 +21,9 @@ export const useEventsRequests: TUseEventsRequests = () => { const headers = {"X-Auth-Token": token.value } const getEventRestUrl = (param: string): string => `${REST_API_URL}/api/event/${param}${project.value ? `?project=${project.value}` : ''}` - const getEventsRestUrl = (): string => `${REST_API_URL}/api/events${project.value ? `?project=${project.value}` : ''}` + const getEventsPreviewRestUrl = (): string => `${REST_API_URL}/api/events/preview${project.value ? `?project=${project.value}` : ''}` - const getAll = () => fetch(getEventsRestUrl(), { headers }) + const getAll = () => fetch(getEventsPreviewRestUrl(), { headers }) .then((response) => response.json()) .then((response) => { if (response?.data) { @@ -59,7 +59,7 @@ export const useEventsRequests: TUseEventsRequests = () => { console.error('Fetch Error', err) }) - const deleteAll = () => fetch(getEventsRestUrl(), { + const deleteAll = () => fetch(getEventsPreviewRestUrl(), { method: 'DELETE', headers, ...(project.value ? { body: JSON.stringify({project: project.value}) } : null) @@ -68,7 +68,7 @@ export const useEventsRequests: TUseEventsRequests = () => { console.error('Fetch Error', err) }) - const deleteList = (uuids: EventId[]) => fetch(getEventsRestUrl(), { + const deleteList = (uuids: EventId[]) => fetch(getEventsPreviewRestUrl(), { method: 'DELETE', headers, body: JSON.stringify({uuids}) @@ -77,7 +77,7 @@ export const useEventsRequests: TUseEventsRequests = () => { console.error('Fetch Error', err) }) - const deleteByType = (type: EventType) => fetch(getEventsRestUrl(), { + const deleteByType = (type: EventType) => fetch(getEventsPreviewRestUrl(), { method: 'DELETE', headers, body: JSON.stringify({