From bacefa8db406aa188d27670649bb57f12a3b4c47 Mon Sep 17 00:00:00 2001 From: Michael Hunteman Date: Sat, 6 Jul 2024 15:24:05 -0700 Subject: Rename to guest --- client/src/apiSlice.ts | 12 ++++++------ client/src/components/Rsvp.tsx | 2 +- client/src/main.tsx | 2 +- client/src/mocks/handlers.ts | 4 ++-- client/src/pages.ts | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) (limited to 'client') diff --git a/client/src/apiSlice.ts b/client/src/apiSlice.ts index 514f8b1..038615f 100644 --- a/client/src/apiSlice.ts +++ b/client/src/apiSlice.ts @@ -39,23 +39,23 @@ export const apiSlice = createApi({ return headers; }, }), - tagTypes: ['Guests'], + tagTypes: ['Guest'], endpoints: (builder) => ({ getGuests: builder.query({ - query: () => 'guests', - providesTags: ['Guests'], + query: () => 'guest', + providesTags: ['Guest'], }), updateGuest: builder.mutation({ query: (guest) => ({ - url: `guests/${guest?.id}`, + url: `guest/${guest?.id}`, method: 'PUT', body: guest, - providesTags: ['Guests'], + providesTags: ['Guest'], }), }), login: builder.mutation({ query: (credentials) => ({ - url: 'guests/login', + url: 'guest/login', method: 'POST', body: credentials, }), diff --git a/client/src/components/Rsvp.tsx b/client/src/components/Rsvp.tsx index fbcaf4a..d908f75 100644 --- a/client/src/components/Rsvp.tsx +++ b/client/src/components/Rsvp.tsx @@ -22,7 +22,7 @@ function Rsvp() { ) : ( - + ); } diff --git a/client/src/main.tsx b/client/src/main.tsx index 88999f7..45ff68b 100644 --- a/client/src/main.tsx +++ b/client/src/main.tsx @@ -31,7 +31,7 @@ const router = createBrowserRouter([ element: , }, { - path: 'guests/login', + path: 'guest/login', element: , }, { diff --git a/client/src/mocks/handlers.ts b/client/src/mocks/handlers.ts index 0e882ee..8dc92b7 100644 --- a/client/src/mocks/handlers.ts +++ b/client/src/mocks/handlers.ts @@ -4,7 +4,7 @@ import { nanoid } from '@reduxjs/toolkit'; const token = nanoid(); export const handlers = [ - http.post('/guests/login', () => { + http.post('/guest/login', () => { return HttpResponse.json({ guest: { id: 1, @@ -17,7 +17,7 @@ export const handlers = [ token, }); }), - http.patch('/guests/1', () => { + http.patch('/guest/1', () => { return HttpResponse.json({ id: 1, firstName: 'Michael', diff --git a/client/src/pages.ts b/client/src/pages.ts index a1dbdfd..8bf5d23 100644 --- a/client/src/pages.ts +++ b/client/src/pages.ts @@ -1,7 +1,7 @@ const pages = [ { name: 'Home', to: '/' }, { name: 'Schedule', to: '/schedule' }, - { name: 'RSVP', to: '/guests/login' }, + { name: 'RSVP', to: '/guest/login' }, { name: 'Registry', to: '/registry' }, ]; -- cgit v1.2.3