Compare commits
4 Commits
f54c87260c
...
3525001035
Author | SHA1 | Date | |
---|---|---|---|
![]() |
3525001035 | ||
fdffbdf5ef | |||
fba75025d4 | |||
8f5c038f9c |
@ -10,6 +10,8 @@ export interface Api<T extends Entity> {
|
||||
create(serializable: Serializable<T>, object: T, callback: (object: T) => void): void;
|
||||
update(serializable: Serializable<T>, object: T, callback: () => void): void;
|
||||
destroy(serializable: Serializable<T>, object: T, callback: () => void): void;
|
||||
|
||||
post(serializable: Serializable<T>, path: string, callback: () => void): void;
|
||||
}
|
||||
|
||||
export interface Serializable<T> {
|
||||
@ -98,4 +100,14 @@ export class AbstractApi<T extends Entity> implements Api<T> {
|
||||
}).then(callback)
|
||||
.catch((error) => console.error(error));
|
||||
}
|
||||
|
||||
post(serializable: Serializable<T>, path: string, callback: () => void): void {
|
||||
fetch(`/api/${getSlug()}/${serializable.apiPath()}/${path}`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': getCsrfToken(),
|
||||
}
|
||||
}).then(callback)
|
||||
.catch((error) => console.error(error));
|
||||
}
|
||||
}
|
||||
|
@ -11,6 +11,7 @@ import { LinkIcon, TrashIcon } from "@heroicons/react/24/outline";
|
||||
import { useEffect, useRef } from "react";
|
||||
import { useState } from "react";
|
||||
import { classNames } from "../components/button";
|
||||
import { Toast } from "primereact/toast";
|
||||
|
||||
function InvitationCard({ invitation, allGuests, onGuestAdded, onDestroy }: {
|
||||
invitation: Invitation,
|
||||
@ -117,6 +118,7 @@ export default function InvitationsBoard({ guests, invitations: originalInvitati
|
||||
guests: Array<Guest>,
|
||||
invitations: Array<Invitation>
|
||||
}) {
|
||||
const toast = useRef<Toast>(null);
|
||||
const api = new AbstractApi<Invitation>();
|
||||
const serializer = new InvitationSerializer();
|
||||
|
||||
@ -146,14 +148,19 @@ export default function InvitationsBoard({ guests, invitations: originalInvitati
|
||||
}
|
||||
|
||||
function handleDownloadQrCodes() {
|
||||
api.getAllPdf(serializer, () => {
|
||||
console.log("QR codes downloaded");
|
||||
api.post(serializer, 'email', () => {
|
||||
toast.current?.show({
|
||||
severity: 'success',
|
||||
summary: 'Email scheduled',
|
||||
detail: 'A document with the QR codes will be sent to the organizer\'s email.'
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="flex h-screen">
|
||||
{/* Left Column: Guests */}
|
||||
<Toast ref={toast} />
|
||||
<div className="w-1/4 h-full overflow-auto border-r border-gray-300 p-4">
|
||||
<h2 className="text-lg font-semibold mb-4">{unassignedGuests.length} guests without invitation</h2>
|
||||
<div>
|
||||
@ -180,7 +187,7 @@ export default function InvitationsBoard({ guests, invitations: originalInvitati
|
||||
onClick={handleDownloadQrCodes}
|
||||
className={classNames('primary')}
|
||||
>
|
||||
Download QR codes
|
||||
Send QR codes via email
|
||||
</button>
|
||||
|
||||
|
||||
|
@ -21,7 +21,7 @@
|
||||
"postcss": "8.5.6",
|
||||
"primeicons": "^7.0.0",
|
||||
"primereact": "^10.8.2",
|
||||
"react": "19.0.0-rc-f38c22b244-20240704",
|
||||
"react": "19.1.0",
|
||||
"react-dom": "19.0.0-rc-f38c22b244-20240704",
|
||||
"tailwindcss": "3.4.17",
|
||||
"typescript": "5.8.3",
|
||||
@ -33,7 +33,7 @@
|
||||
"@playwright/test": "^1.52.0",
|
||||
"@types/bcrypt": "^5.0.2",
|
||||
"@types/node": "24.0.10",
|
||||
"@types/react": "18.3.23",
|
||||
"@types/react": "19.1.8",
|
||||
"@types/react-dom": "18.3.7",
|
||||
"wait-on": "^8.0.3"
|
||||
},
|
||||
|
110
pnpm-lock.yaml
generated
110
pnpm-lock.yaml
generated
@ -13,7 +13,7 @@ importers:
|
||||
version: 1.7.4
|
||||
'@heroicons/react':
|
||||
specifier: ^2.1.4
|
||||
version: 2.2.0(react@19.0.0-rc-f38c22b244-20240704)
|
||||
version: 2.2.0(react@19.1.0)
|
||||
'@tailwindcss/forms':
|
||||
specifier: ^0.5.7
|
||||
version: 0.5.10(tailwindcss@3.4.17)
|
||||
@ -22,7 +22,7 @@ importers:
|
||||
version: 2.23.0
|
||||
'@tiptap/react':
|
||||
specifier: ^2.14.0
|
||||
version: 2.25.0(@tiptap/core@2.14.0(@tiptap/pm@2.23.0))(@tiptap/pm@2.23.0)(react-dom@19.0.0-rc-f38c22b244-20240704(react@19.0.0-rc-f38c22b244-20240704))(react@19.0.0-rc-f38c22b244-20240704)
|
||||
version: 2.25.0(@tiptap/core@2.14.0(@tiptap/pm@2.23.0))(@tiptap/pm@2.23.0)(react-dom@19.0.0-rc-f38c22b244-20240704(react@19.1.0))(react@19.1.0)
|
||||
'@tiptap/starter-kit':
|
||||
specifier: ^2.14.0
|
||||
version: 2.14.0
|
||||
@ -40,10 +40,10 @@ importers:
|
||||
version: 3.2.6
|
||||
next:
|
||||
specifier: 15.3.5
|
||||
version: 15.3.5(@playwright/test@1.53.2)(react-dom@19.0.0-rc-f38c22b244-20240704(react@19.0.0-rc-f38c22b244-20240704))(react@19.0.0-rc-f38c22b244-20240704)
|
||||
version: 15.3.5(@playwright/test@1.53.2)(react-dom@19.0.0-rc-f38c22b244-20240704(react@19.1.0))(react@19.1.0)
|
||||
next-auth:
|
||||
specifier: 5.0.0-beta.29
|
||||
version: 5.0.0-beta.29(next@15.3.5(@playwright/test@1.53.2)(react-dom@19.0.0-rc-f38c22b244-20240704(react@19.0.0-rc-f38c22b244-20240704))(react@19.0.0-rc-f38c22b244-20240704))(react@19.0.0-rc-f38c22b244-20240704)
|
||||
version: 5.0.0-beta.29(next@15.3.5(@playwright/test@1.53.2)(react-dom@19.0.0-rc-f38c22b244-20240704(react@19.1.0))(react@19.1.0))(react@19.1.0)
|
||||
postcss:
|
||||
specifier: 8.5.6
|
||||
version: 8.5.6
|
||||
@ -52,13 +52,13 @@ importers:
|
||||
version: 7.0.0
|
||||
primereact:
|
||||
specifier: ^10.8.2
|
||||
version: 10.9.6(@types/react@18.3.23)(react-dom@19.0.0-rc-f38c22b244-20240704(react@19.0.0-rc-f38c22b244-20240704))(react@19.0.0-rc-f38c22b244-20240704)
|
||||
version: 10.9.6(@types/react@19.1.8)(react-dom@19.0.0-rc-f38c22b244-20240704(react@19.1.0))(react@19.1.0)
|
||||
react:
|
||||
specifier: 19.0.0-rc-f38c22b244-20240704
|
||||
version: 19.0.0-rc-f38c22b244-20240704
|
||||
specifier: 19.1.0
|
||||
version: 19.1.0
|
||||
react-dom:
|
||||
specifier: 19.0.0-rc-f38c22b244-20240704
|
||||
version: 19.0.0-rc-f38c22b244-20240704(react@19.0.0-rc-f38c22b244-20240704)
|
||||
version: 19.0.0-rc-f38c22b244-20240704(react@19.1.0)
|
||||
tailwindcss:
|
||||
specifier: 3.4.17
|
||||
version: 3.4.17
|
||||
@ -67,7 +67,7 @@ importers:
|
||||
version: 5.8.3
|
||||
use-debounce:
|
||||
specifier: ^10.0.1
|
||||
version: 10.0.5(react@19.0.0-rc-f38c22b244-20240704)
|
||||
version: 10.0.5(react@19.1.0)
|
||||
uuid:
|
||||
specifier: 11.1.0
|
||||
version: 11.1.0
|
||||
@ -85,11 +85,11 @@ importers:
|
||||
specifier: 24.0.10
|
||||
version: 24.0.10
|
||||
'@types/react':
|
||||
specifier: 18.3.23
|
||||
version: 18.3.23
|
||||
specifier: 19.1.8
|
||||
version: 19.1.8
|
||||
'@types/react-dom':
|
||||
specifier: 18.3.7
|
||||
version: 18.3.7(@types/react@18.3.23)
|
||||
version: 18.3.7(@types/react@19.1.8)
|
||||
wait-on:
|
||||
specifier: ^8.0.3
|
||||
version: 8.0.3
|
||||
@ -514,9 +514,6 @@ packages:
|
||||
'@types/node@24.0.10':
|
||||
resolution: {integrity: sha512-ENHwaH+JIRTDIEEbDK6QSQntAYGtbvdDXnMXnZaZ6k13Du1dPMmprkEHIL7ok2Wl2aZevetwTAb5S+7yIF+enA==}
|
||||
|
||||
'@types/prop-types@15.7.12':
|
||||
resolution: {integrity: sha512-5zvhXYtRNRluoE/jAp4GVsSduVUzNWKkOZrCDBWYtE7biZywwdC2AcEzg+cSMLFRfVgeAFqpfNabiPjxFddV1Q==}
|
||||
|
||||
'@types/react-dom@18.3.7':
|
||||
resolution: {integrity: sha512-MEe3UeoENYVFXzoXEWsvcpg6ZvlrFNlOQ7EOsvhI3CfAXwzPfO8Qwuxd40nepsYKqyyVQnTdEfv68q91yLcKrQ==}
|
||||
peerDependencies:
|
||||
@ -527,8 +524,8 @@ packages:
|
||||
peerDependencies:
|
||||
'@types/react': '*'
|
||||
|
||||
'@types/react@18.3.23':
|
||||
resolution: {integrity: sha512-/LDXMQh55EzZQ0uVAZmKKhfENivEvWz6E+EYzh+/MCjMhNsotd+ZHhBGIjFDTi6+fz0OhQQQLbTgdQIxxCsC0w==}
|
||||
'@types/react@19.1.8':
|
||||
resolution: {integrity: sha512-AwAfQ2Wa5bCx9WP8nZL2uMZWod7J7/JSplxbTmBQ5ms6QpqNYm672H0Vu9ZVKVngQ+ii4R/byguVEUZQyeg44g==}
|
||||
|
||||
'@types/trusted-types@2.0.7':
|
||||
resolution: {integrity: sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==}
|
||||
@ -1193,8 +1190,8 @@ packages:
|
||||
react: '>=16.6.0'
|
||||
react-dom: '>=16.6.0'
|
||||
|
||||
react@19.0.0-rc-f38c22b244-20240704:
|
||||
resolution: {integrity: sha512-OP8O6Oc1rdR9IdIKJRKaL1PYd4eGkn6f88VqiygWyyG4P4RmPPix5pp7MatqSt9TnBOcVT+lBMGoVxRgUFeudQ==}
|
||||
react@19.1.0:
|
||||
resolution: {integrity: sha512-FS+XFBNvn3GTAWq26joslQgWNoFu08F4kl0J4CgdNKADkdSGXQyTCnKteIAJy96Br6YbpEU1LSzV5dYtjMkMDg==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
|
||||
read-cache@1.0.0:
|
||||
@ -1414,9 +1411,9 @@ snapshots:
|
||||
dependencies:
|
||||
'@hapi/hoek': 9.3.0
|
||||
|
||||
'@heroicons/react@2.2.0(react@19.0.0-rc-f38c22b244-20240704)':
|
||||
'@heroicons/react@2.2.0(react@19.1.0)':
|
||||
dependencies:
|
||||
react: 19.0.0-rc-f38c22b244-20240704
|
||||
react: 19.1.0
|
||||
|
||||
'@img/sharp-darwin-arm64@0.34.1':
|
||||
optionalDependencies:
|
||||
@ -1710,7 +1707,7 @@ snapshots:
|
||||
prosemirror-transform: 1.10.4
|
||||
prosemirror-view: 1.40.0
|
||||
|
||||
'@tiptap/react@2.25.0(@tiptap/core@2.14.0(@tiptap/pm@2.23.0))(@tiptap/pm@2.23.0)(react-dom@19.0.0-rc-f38c22b244-20240704(react@19.0.0-rc-f38c22b244-20240704))(react@19.0.0-rc-f38c22b244-20240704)':
|
||||
'@tiptap/react@2.25.0(@tiptap/core@2.14.0(@tiptap/pm@2.23.0))(@tiptap/pm@2.23.0)(react-dom@19.0.0-rc-f38c22b244-20240704(react@19.1.0))(react@19.1.0)':
|
||||
dependencies:
|
||||
'@tiptap/core': 2.14.0(@tiptap/pm@2.23.0)
|
||||
'@tiptap/extension-bubble-menu': 2.25.0(@tiptap/core@2.14.0(@tiptap/pm@2.23.0))(@tiptap/pm@2.23.0)
|
||||
@ -1718,9 +1715,9 @@ snapshots:
|
||||
'@tiptap/pm': 2.23.0
|
||||
'@types/use-sync-external-store': 0.0.6
|
||||
fast-deep-equal: 3.1.3
|
||||
react: 19.0.0-rc-f38c22b244-20240704
|
||||
react-dom: 19.0.0-rc-f38c22b244-20240704(react@19.0.0-rc-f38c22b244-20240704)
|
||||
use-sync-external-store: 1.5.0(react@19.0.0-rc-f38c22b244-20240704)
|
||||
react: 19.1.0
|
||||
react-dom: 19.0.0-rc-f38c22b244-20240704(react@19.1.0)
|
||||
use-sync-external-store: 1.5.0(react@19.1.0)
|
||||
|
||||
'@tiptap/starter-kit@2.14.0':
|
||||
dependencies:
|
||||
@ -1763,19 +1760,16 @@ snapshots:
|
||||
dependencies:
|
||||
undici-types: 7.8.0
|
||||
|
||||
'@types/prop-types@15.7.12': {}
|
||||
|
||||
'@types/react-dom@18.3.7(@types/react@18.3.23)':
|
||||
'@types/react-dom@18.3.7(@types/react@19.1.8)':
|
||||
dependencies:
|
||||
'@types/react': 18.3.23
|
||||
'@types/react': 19.1.8
|
||||
|
||||
'@types/react-transition-group@4.4.12(@types/react@18.3.23)':
|
||||
'@types/react-transition-group@4.4.12(@types/react@19.1.8)':
|
||||
dependencies:
|
||||
'@types/react': 18.3.23
|
||||
'@types/react': 19.1.8
|
||||
|
||||
'@types/react@18.3.23':
|
||||
'@types/react@19.1.8':
|
||||
dependencies:
|
||||
'@types/prop-types': 15.7.12
|
||||
csstype: 3.1.3
|
||||
|
||||
'@types/trusted-types@2.0.7':
|
||||
@ -2160,13 +2154,13 @@ snapshots:
|
||||
|
||||
nanoid@3.3.11: {}
|
||||
|
||||
next-auth@5.0.0-beta.29(next@15.3.5(@playwright/test@1.53.2)(react-dom@19.0.0-rc-f38c22b244-20240704(react@19.0.0-rc-f38c22b244-20240704))(react@19.0.0-rc-f38c22b244-20240704))(react@19.0.0-rc-f38c22b244-20240704):
|
||||
next-auth@5.0.0-beta.29(next@15.3.5(@playwright/test@1.53.2)(react-dom@19.0.0-rc-f38c22b244-20240704(react@19.1.0))(react@19.1.0))(react@19.1.0):
|
||||
dependencies:
|
||||
'@auth/core': 0.40.0
|
||||
next: 15.3.5(@playwright/test@1.53.2)(react-dom@19.0.0-rc-f38c22b244-20240704(react@19.0.0-rc-f38c22b244-20240704))(react@19.0.0-rc-f38c22b244-20240704)
|
||||
react: 19.0.0-rc-f38c22b244-20240704
|
||||
next: 15.3.5(@playwright/test@1.53.2)(react-dom@19.0.0-rc-f38c22b244-20240704(react@19.1.0))(react@19.1.0)
|
||||
react: 19.1.0
|
||||
|
||||
next@15.3.5(@playwright/test@1.53.2)(react-dom@19.0.0-rc-f38c22b244-20240704(react@19.0.0-rc-f38c22b244-20240704))(react@19.0.0-rc-f38c22b244-20240704):
|
||||
next@15.3.5(@playwright/test@1.53.2)(react-dom@19.0.0-rc-f38c22b244-20240704(react@19.1.0))(react@19.1.0):
|
||||
dependencies:
|
||||
'@next/env': 15.3.5
|
||||
'@swc/counter': 0.1.3
|
||||
@ -2174,9 +2168,9 @@ snapshots:
|
||||
busboy: 1.6.0
|
||||
caniuse-lite: 1.0.30001702
|
||||
postcss: 8.4.31
|
||||
react: 19.0.0-rc-f38c22b244-20240704
|
||||
react-dom: 19.0.0-rc-f38c22b244-20240704(react@19.0.0-rc-f38c22b244-20240704)
|
||||
styled-jsx: 5.1.6(react@19.0.0-rc-f38c22b244-20240704)
|
||||
react: 19.1.0
|
||||
react-dom: 19.0.0-rc-f38c22b244-20240704(react@19.1.0)
|
||||
styled-jsx: 5.1.6(react@19.1.0)
|
||||
optionalDependencies:
|
||||
'@next/swc-darwin-arm64': 15.3.5
|
||||
'@next/swc-darwin-x64': 15.3.5
|
||||
@ -2286,14 +2280,14 @@ snapshots:
|
||||
|
||||
primeicons@7.0.0: {}
|
||||
|
||||
primereact@10.9.6(@types/react@18.3.23)(react-dom@19.0.0-rc-f38c22b244-20240704(react@19.0.0-rc-f38c22b244-20240704))(react@19.0.0-rc-f38c22b244-20240704):
|
||||
primereact@10.9.6(@types/react@19.1.8)(react-dom@19.0.0-rc-f38c22b244-20240704(react@19.1.0))(react@19.1.0):
|
||||
dependencies:
|
||||
'@types/react-transition-group': 4.4.12(@types/react@18.3.23)
|
||||
react: 19.0.0-rc-f38c22b244-20240704
|
||||
react-dom: 19.0.0-rc-f38c22b244-20240704(react@19.0.0-rc-f38c22b244-20240704)
|
||||
react-transition-group: 4.4.5(react-dom@19.0.0-rc-f38c22b244-20240704(react@19.0.0-rc-f38c22b244-20240704))(react@19.0.0-rc-f38c22b244-20240704)
|
||||
'@types/react-transition-group': 4.4.12(@types/react@19.1.8)
|
||||
react: 19.1.0
|
||||
react-dom: 19.0.0-rc-f38c22b244-20240704(react@19.1.0)
|
||||
react-transition-group: 4.4.5(react-dom@19.0.0-rc-f38c22b244-20240704(react@19.1.0))(react@19.1.0)
|
||||
optionalDependencies:
|
||||
'@types/react': 18.3.23
|
||||
'@types/react': 19.1.8
|
||||
|
||||
prop-types@15.8.1:
|
||||
dependencies:
|
||||
@ -2412,23 +2406,23 @@ snapshots:
|
||||
|
||||
raf-schd@4.0.3: {}
|
||||
|
||||
react-dom@19.0.0-rc-f38c22b244-20240704(react@19.0.0-rc-f38c22b244-20240704):
|
||||
react-dom@19.0.0-rc-f38c22b244-20240704(react@19.1.0):
|
||||
dependencies:
|
||||
react: 19.0.0-rc-f38c22b244-20240704
|
||||
react: 19.1.0
|
||||
scheduler: 0.25.0-rc-f38c22b244-20240704
|
||||
|
||||
react-is@16.13.1: {}
|
||||
|
||||
react-transition-group@4.4.5(react-dom@19.0.0-rc-f38c22b244-20240704(react@19.0.0-rc-f38c22b244-20240704))(react@19.0.0-rc-f38c22b244-20240704):
|
||||
react-transition-group@4.4.5(react-dom@19.0.0-rc-f38c22b244-20240704(react@19.1.0))(react@19.1.0):
|
||||
dependencies:
|
||||
'@babel/runtime': 7.27.6
|
||||
dom-helpers: 5.2.1
|
||||
loose-envify: 1.4.0
|
||||
prop-types: 15.8.1
|
||||
react: 19.0.0-rc-f38c22b244-20240704
|
||||
react-dom: 19.0.0-rc-f38c22b244-20240704(react@19.0.0-rc-f38c22b244-20240704)
|
||||
react: 19.1.0
|
||||
react-dom: 19.0.0-rc-f38c22b244-20240704(react@19.1.0)
|
||||
|
||||
react@19.0.0-rc-f38c22b244-20240704: {}
|
||||
react@19.1.0: {}
|
||||
|
||||
read-cache@1.0.0:
|
||||
dependencies:
|
||||
@ -2526,10 +2520,10 @@ snapshots:
|
||||
dependencies:
|
||||
ansi-regex: 6.0.1
|
||||
|
||||
styled-jsx@5.1.6(react@19.0.0-rc-f38c22b244-20240704):
|
||||
styled-jsx@5.1.6(react@19.1.0):
|
||||
dependencies:
|
||||
client-only: 0.0.1
|
||||
react: 19.0.0-rc-f38c22b244-20240704
|
||||
react: 19.1.0
|
||||
|
||||
sucrase@3.35.0:
|
||||
dependencies:
|
||||
@ -2602,13 +2596,13 @@ snapshots:
|
||||
escalade: 3.2.0
|
||||
picocolors: 1.1.1
|
||||
|
||||
use-debounce@10.0.5(react@19.0.0-rc-f38c22b244-20240704):
|
||||
use-debounce@10.0.5(react@19.1.0):
|
||||
dependencies:
|
||||
react: 19.0.0-rc-f38c22b244-20240704
|
||||
react: 19.1.0
|
||||
|
||||
use-sync-external-store@1.5.0(react@19.0.0-rc-f38c22b244-20240704):
|
||||
use-sync-external-store@1.5.0(react@19.1.0):
|
||||
dependencies:
|
||||
react: 19.0.0-rc-f38c22b244-20240704
|
||||
react: 19.1.0
|
||||
|
||||
util-deprecate@1.0.2: {}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user