feat(demo): add the jury guide and demonstration markers to the demo stand build

This commit is contained in:
shira committed 2026-10-10 01:27:17 +03:00
1 parent d365a05c96
commit 41206abbcf
32 files changed
+1096 -141

No files matched your search

@@ -1,13 +1,17 @@
import { ApiRequestError, invalidResponseCode } from "../../../shared/api";
import {
createOrganizationInvitation,
getGetOrganizationInvitationContactsQueryKey,
getGetOrganizationInvitationQueryKey,
getOrganizationInvitation,
getOrganizationInvitationContacts,
sendOrganizationInvitation,
updateOrganizationInvitation,
} from "../../../shared/api/endpoints/invitation/invitation";
import {
ContactDisclosure as contactDisclosureSchema,
OrganizationInvitation as organizationInvitationSchema,
type ContactDisclosure,
type OrganizationInvitation,
type OrganizationInvitationCreate,
type OrganizationInvitationUpdate,
@@ -100,8 +104,30 @@ export async function readOrganizationInvitation(
);
}
/**
* Reads the contacts that an active grant of an accepted invitation covers.
* The server answers 404 when no grant is readable, which the caller shows as
* "not available" without asking for a reason.
*/
export async function readInvitationContacts(
organizationId: string,
invitationId: string,
signal: AbortSignal | undefined = undefined,
): Promise<ContactDisclosure> {
const parsed = contactDisclosureSchema.safeParse(
await getOrganizationInvitationContacts(organizationId, invitationId, signal ? { signal } : {}),
);
if (!parsed.success) throw invalidResponse();
return parsed.data;
}
/** Invitation reads stay separate for each signed-in account. */
export const invitationQueryKeys = {
detail: (accountId: string, organizationId: string, invitationId: string) =>
[...getGetOrganizationInvitationQueryKey(organizationId, invitationId), accountId] as const,
contacts: (accountId: string, organizationId: string, invitationId: string) =>
[
...getGetOrganizationInvitationContactsQueryKey(organizationId, invitationId),
accountId,
] as const,
};