diff options
author | Michael Hunteman <michael@huntm.net> | 2024-08-30 14:45:50 -0700 |
---|---|---|
committer | Michael Hunteman <michael@huntm.net> | 2024-08-30 14:45:50 -0700 |
commit | 340193f1d52e1b68fe950974d1003b9330e06fe3 (patch) | |
tree | 68dc6ddc99a0bffaf47dfa7f7bf591103b0d36d2 /client/src/slices | |
parent | 1d2ffb8a2b6af752b6fd091e8e59682625c2b495 (diff) |
Update material react table to have party guests
Diffstat (limited to 'client/src/slices')
-rw-r--r-- | client/src/slices/api/adminSlice.ts | 27 | ||||
-rw-r--r-- | client/src/slices/api/guestSlice.ts | 31 | ||||
-rw-r--r-- | client/src/slices/auth/adminSlice.ts | 2 | ||||
-rw-r--r-- | client/src/slices/auth/guestSlice.ts | 2 |
4 files changed, 8 insertions, 54 deletions
diff --git a/client/src/slices/api/adminSlice.ts b/client/src/slices/api/adminSlice.ts index cd1638d..bd69502 100644 --- a/client/src/slices/api/adminSlice.ts +++ b/client/src/slices/api/adminSlice.ts @@ -1,31 +1,6 @@ import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query/react'; import type { RootState } from '../../store'; - -export interface Guest { - id: number; - firstName: string; - lastName: string; - attendance: string; - email: string; - message: string; - partySize: number; - partyList: Array<PartyGuest>; -} - -export interface PartyGuest { - firstName: string; - lastName: string; -} - -export interface AdminLoginRequest { - username: string; - password: string; -} - -export interface AdminLoginResponse { - guests: Guest[]; - token: string; -} +import type { AdminLoginRequest, AdminLoginResponse } from '../../models'; export const adminSlice = createApi({ reducerPath: 'adminApi', diff --git a/client/src/slices/api/guestSlice.ts b/client/src/slices/api/guestSlice.ts index b009ff0..fab0454 100644 --- a/client/src/slices/api/guestSlice.ts +++ b/client/src/slices/api/guestSlice.ts @@ -1,31 +1,10 @@ import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query/react'; import type { RootState } from '../../store'; - -export interface GuestLoginRequest { - firstName: string; - lastName: string; -} - -export interface GuestLoginResponse { - guest: Guest; - token: string; -} - -export interface Guest { - id: number; - firstName: string; - lastName: string; - attendance: string; - email: string; - message: string; - partySize: number; - partyList: Array<PartyGuest>; -} - -export interface PartyGuest { - firstName: string; - lastName: string; -} +import type { + Guest, + GuestLoginRequest, + GuestLoginResponse, +} from '../../models'; export const guestSlice = createApi({ reducerPath: 'guestApi', diff --git a/client/src/slices/auth/adminSlice.ts b/client/src/slices/auth/adminSlice.ts index 8753b55..330fdb8 100644 --- a/client/src/slices/auth/adminSlice.ts +++ b/client/src/slices/auth/adminSlice.ts @@ -1,7 +1,7 @@ import { createSlice } from '@reduxjs/toolkit'; import type { PayloadAction } from '@reduxjs/toolkit'; import type { RootState } from '../../store'; -import type { Guest } from '../api/guestSlice'; +import type { Guest } from '../../models'; type AdminAuth = { guests?: Guest[]; diff --git a/client/src/slices/auth/guestSlice.ts b/client/src/slices/auth/guestSlice.ts index 701148e..fb4afaf 100644 --- a/client/src/slices/auth/guestSlice.ts +++ b/client/src/slices/auth/guestSlice.ts @@ -1,7 +1,7 @@ import { createSlice } from '@reduxjs/toolkit'; import type { PayloadAction } from '@reduxjs/toolkit'; import type { RootState } from '../../store'; -import type { Guest } from '../api/guestSlice'; +import type { Guest } from '../../models'; type GuestAuth = { guest?: Guest; |