summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Hunteman <michael@huntm.net>2024-04-28 08:19:04 -0700
committerMichael Hunteman <michael@huntm.net>2024-04-28 08:19:04 -0700
commit53851a49c8cd6cb7a6ff2517c9193bd2fd552062 (patch)
tree7cb41903ad541c661320e36fd63b96c6a8997ba4
parent1324f5f2a5dcba40d44e392d75ff5966264e8d58 (diff)
Update guest interface
-rw-r--r--src/apiSlice.ts7
-rw-r--r--src/components/RsvpForm.tsx7
-rw-r--r--src/features/auth/authSlice.ts6
3 files changed, 14 insertions, 6 deletions
diff --git a/src/apiSlice.ts b/src/apiSlice.ts
index 3305dbf..5d987f9 100644
--- a/src/apiSlice.ts
+++ b/src/apiSlice.ts
@@ -18,6 +18,13 @@ export interface Guest {
attendance: string;
email: string;
message: string;
+ partySize: number;
+ partyList: Array<PartyGuest>;
+}
+
+export interface PartyGuest {
+ firstName: string;
+ lastName: string;
}
export const apiSlice = createApi({
diff --git a/src/components/RsvpForm.tsx b/src/components/RsvpForm.tsx
index 99d3059..71db0d8 100644
--- a/src/components/RsvpForm.tsx
+++ b/src/components/RsvpForm.tsx
@@ -48,8 +48,9 @@ function RsvpForm() {
lastName: guest?.lastName,
attendance: '',
email: '',
- partySize: 1,
message: '',
+ partySize: 1,
+ partyList: [],
},
});
@@ -97,8 +98,8 @@ function RsvpForm() {
<Grid item xs={12}>
<p>
Please RSVP for the wedding by March 10, 2025. The ceremony will
- commence at 3 pm on April 26 in Divine Shepherd. The reception will
- follow at 5 pm in A Venue on the Ridge.
+ commence at 3 PM on April 26 in Divine Shepherd. The reception will
+ follow at 5 PM in A Venue on the Ridge.
</p>
</Grid>
<Grid item xs={12}>
diff --git a/src/features/auth/authSlice.ts b/src/features/auth/authSlice.ts
index 5eccd65..bff2bdd 100644
--- a/src/features/auth/authSlice.ts
+++ b/src/features/auth/authSlice.ts
@@ -3,13 +3,13 @@ import type { RootState } from '../../store';
import type { Guest } from '../../apiSlice';
type AuthState = {
- guest: Guest | null;
- token: string | null;
+ guest?: Guest;
+ token?: string;
};
const authSlice = createSlice({
name: 'auth',
- initialState: { guest: null, token: null } as AuthState,
+ initialState: { guest: undefined, token: undefined } as AuthState,
reducers: {
setCredentials: (state, action) => {
const { guest, token } = action.payload;