summaryrefslogtreecommitdiff
path: root/client/src/mocks/handlers.ts
diff options
context:
space:
mode:
authorMichael Hunteman <michael@huntm.net>2024-05-17 15:20:30 -0700
committerMichael Hunteman <michael@huntm.net>2024-05-17 15:20:30 -0700
commit7103019890960e793deefb64987a09b33be60b42 (patch)
treec1c9402aa250c68b2cbe13d62598232bbf20b1e2 /client/src/mocks/handlers.ts
parentfc5c111bcfe296bec82e1cf9fdb88fc80fb24f89 (diff)
Add golang server
Diffstat (limited to 'client/src/mocks/handlers.ts')
-rw-r--r--client/src/mocks/handlers.ts30
1 files changed, 30 insertions, 0 deletions
diff --git a/client/src/mocks/handlers.ts b/client/src/mocks/handlers.ts
new file mode 100644
index 0000000..217a7d5
--- /dev/null
+++ b/client/src/mocks/handlers.ts
@@ -0,0 +1,30 @@
+import { http, HttpResponse } from 'msw';
+import { nanoid } from '@reduxjs/toolkit';
+
+const token = nanoid();
+
+export const handlers = [
+ http.post('/guest-login', () => {
+ return HttpResponse.json({
+ guest: {
+ id: 1,
+ firstName: 'Michael',
+ lastName: 'Hunteman',
+ attendance: 'false',
+ email: '',
+ message: '',
+ },
+ token,
+ });
+ }),
+ http.patch('/guests/1', () => {
+ return HttpResponse.json({
+ id: 1,
+ firstName: 'Michael',
+ lastName: 'Hunteman',
+ attendance: 'true',
+ email: '',
+ message: '',
+ });
+ }),
+];