From 355247124be618a3fe4da692fdb732de04b7560d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dafydd=20Ll=C5=B7r=20Pearson?= Date: Mon, 25 Mar 2024 09:09:52 +0000 Subject: [PATCH] fix: Made reference_code mandatory --- src/requests/team.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/requests/team.ts b/src/requests/team.ts index 29e47ee8..9aff9548 100644 --- a/src/requests/team.ts +++ b/src/requests/team.ts @@ -25,7 +25,7 @@ interface CreateTeam { homepage: string; submissionEmail?: string; boundary?: GeoJsonObject; - referenceCode?: string; + referenceCode: string; } export class TeamClient { @@ -122,8 +122,8 @@ export async function createTeam( homepage, }, notifyPersonalisation: defaultNotifyPersonalisation, + referenceCode, ...(boundary && { boundary }), - ...(referenceCode && { referenceCode }), }; const response: { insert_teams_one: { id: number } } = await client.request( gql` @@ -134,7 +134,7 @@ export async function createTeam( $submissionEmail: String $notifyPersonalisation: jsonb! $boundary: jsonb - $referenceCode: String + $referenceCode: String! ) { insert_teams_one( object: { @@ -143,9 +143,9 @@ export async function createTeam( settings: $settings submission_email: $submissionEmail notify_personalisation: $notifyPersonalisation + reference_code: $referenceCode # Fall back to default values for optional values ${boundary ? "boundary: $boundary" : ""} - ${referenceCode ? "reference_code: $referenceCode" : ""} # Create empty records for theme and integrations - these can get populated later theme: { data: {} } integrations: { data: {} }