Skip to content

Commit

Permalink
#151 update preview events endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Kreezag committed Jul 28, 2024
1 parent 04f5997 commit cfda2aa
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/shared/lib/io/use-events-requests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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)
Expand All @@ -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})
Expand All @@ -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({
Expand Down

0 comments on commit cfda2aa

Please sign in to comment.