Add photobooth connect code UI
This commit is contained in:
@@ -218,6 +218,11 @@ export type PhotoboothStatus = {
|
||||
metrics?: PhotoboothStatusMetrics | null;
|
||||
};
|
||||
|
||||
export type PhotoboothConnectCode = {
|
||||
code: string;
|
||||
expires_at: string | null;
|
||||
};
|
||||
|
||||
export type EventAddonCheckout = {
|
||||
addon_key: string;
|
||||
quantity?: number;
|
||||
@@ -2041,6 +2046,28 @@ export async function disableEventPhotobooth(slug: string, options?: { mode?: 'f
|
||||
);
|
||||
}
|
||||
|
||||
export async function createEventPhotoboothConnectCode(
|
||||
slug: string,
|
||||
options?: { expires_in_minutes?: number }
|
||||
): Promise<PhotoboothConnectCode> {
|
||||
const body = options ? JSON.stringify(options) : undefined;
|
||||
const headers = body ? { 'Content-Type': 'application/json' } : undefined;
|
||||
|
||||
const response = await authorizedFetch(`${photoboothEndpoint(slug)}/connect-codes`, {
|
||||
method: 'POST',
|
||||
body,
|
||||
headers,
|
||||
});
|
||||
|
||||
const data = await jsonOrThrow<{ data?: JsonValue }>(response, 'Failed to create photobooth connect code');
|
||||
const record = (data.data ?? {}) as Record<string, JsonValue>;
|
||||
|
||||
return {
|
||||
code: typeof record.code === 'string' ? record.code : '',
|
||||
expires_at: typeof record.expires_at === 'string' ? record.expires_at : null,
|
||||
};
|
||||
}
|
||||
|
||||
export async function submitTenantFeedback(payload: {
|
||||
category: string;
|
||||
sentiment?: 'positive' | 'neutral' | 'negative';
|
||||
|
||||
Reference in New Issue
Block a user