summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorMichael Hunteman <michael@huntm.net>2024-07-06 15:24:05 -0700
committerMichael Hunteman <michael@huntm.net>2024-07-06 15:24:43 -0700
commitbacefa8db406aa188d27670649bb57f12a3b4c47 (patch)
treea6fb8996b940b6016d314d29fdd265ce6d74275e /client
parentb9b8099da1a098300d11e0f479d56e24e363e076 (diff)
Rename to guest
Diffstat (limited to 'client')
-rw-r--r--client/src/apiSlice.ts12
-rw-r--r--client/src/components/Rsvp.tsx2
-rw-r--r--client/src/main.tsx2
-rw-r--r--client/src/mocks/handlers.ts4
-rw-r--r--client/src/pages.ts2
5 files changed, 11 insertions, 11 deletions
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<void, void>({
- query: () => 'guests',
- providesTags: ['Guests'],
+ query: () => 'guest',
+ providesTags: ['Guest'],
}),
updateGuest: builder.mutation<Guest, Guest>({
query: (guest) => ({
- url: `guests/${guest?.id}`,
+ url: `guest/${guest?.id}`,
method: 'PUT',
body: guest,
- providesTags: ['Guests'],
+ providesTags: ['Guest'],
}),
}),
login: builder.mutation<LoginResponse, LoginRequest>({
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() {
<Outlet context={auth?.guest} />
</>
) : (
- <Navigate to="/guests/login" state={{ from: location }} replace />
+ <Navigate to="/guest/login" state={{ from: location }} replace />
);
}
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: <Registry />,
},
{
- path: 'guests/login',
+ path: 'guest/login',
element: <GuestLogin />,
},
{
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' },
];