From 9e6c97e532ef9970fc975123abaca86c4ce9b6b1 Mon Sep 17 00:00:00 2001 From: Michael Hunteman Date: Sat, 31 Aug 2024 16:09:58 -0700 Subject: Update type names --- client/src/slices/api/adminSlice.ts | 4 ++-- client/src/slices/api/guestSlice.ts | 12 ++++-------- 2 files changed, 6 insertions(+), 10 deletions(-) (limited to 'client/src/slices') diff --git a/client/src/slices/api/adminSlice.ts b/client/src/slices/api/adminSlice.ts index bd69502..5de5c4d 100644 --- a/client/src/slices/api/adminSlice.ts +++ b/client/src/slices/api/adminSlice.ts @@ -1,6 +1,6 @@ import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query/react'; import type { RootState } from '../../store'; -import type { AdminLoginRequest, AdminLoginResponse } from '../../models'; +import type { Credentials, AdminLogin } from '../../models'; export const adminSlice = createApi({ reducerPath: 'adminApi', @@ -15,7 +15,7 @@ export const adminSlice = createApi({ }, }), endpoints: (builder) => ({ - loginAdmin: builder.mutation({ + loginAdmin: builder.mutation({ query: (credentials) => ({ url: 'admin/login', method: 'POST', diff --git a/client/src/slices/api/guestSlice.ts b/client/src/slices/api/guestSlice.ts index a7dbcc4..312a665 100644 --- a/client/src/slices/api/guestSlice.ts +++ b/client/src/slices/api/guestSlice.ts @@ -1,10 +1,6 @@ import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query/react'; import type { RootState } from '../../store'; -import type { - Guest, - GuestLoginRequest, - GuestLoginResponse, -} from '../../models'; +import type { Guest, Name, GuestLogin } from '../../models'; export const guestSlice = createApi({ reducerPath: 'guestApi', @@ -19,11 +15,11 @@ export const guestSlice = createApi({ }, }), endpoints: (builder) => ({ - loginGuest: builder.mutation({ - query: (credentials) => ({ + loginGuest: builder.mutation({ + query: (name) => ({ url: 'login', method: 'POST', - body: credentials, + body: name, }), }), updateGuest: builder.mutation({ -- cgit v1.2.3