From 6a2ea7a0fe03c2bc01d09fbb020f4dd173760c4d Mon Sep 17 00:00:00 2001 From: casperiv0 <53900565+casperiv0@users.noreply.github.com> Date: Sat, 16 Dec 2023 10:33:58 +0100 Subject: [PATCH] fix: unable to use {callsign} in template (closes #1883) --- .../admin/manage/cad-settings/misc-features/template-tab.tsx | 2 +- packages/utils/src/callsign.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/client/src/components/admin/manage/cad-settings/misc-features/template-tab.tsx b/apps/client/src/components/admin/manage/cad-settings/misc-features/template-tab.tsx index d8b249d94..51e71e8de 100644 --- a/apps/client/src/components/admin/manage/cad-settings/misc-features/template-tab.tsx +++ b/apps/client/src/components/admin/manage/cad-settings/misc-features/template-tab.tsx @@ -13,7 +13,7 @@ import type { MiscCadSettings } from "@snailycad/types"; export const CALLSIGN_TEMPLATE_VARIABLES = ( - {"{department}"},{"{division}"}, {"{callsign}"},{" "} + {"{department}"},{"{division}"}, {"{callsign1}"},{" "} {"{callsign2}"} ); diff --git a/packages/utils/src/callsign.ts b/packages/utils/src/callsign.ts index af8a46d63..63ca664c9 100644 --- a/packages/utils/src/callsign.ts +++ b/packages/utils/src/callsign.ts @@ -38,6 +38,7 @@ export function generateCallsign(unit: Unit, template: string | null) { const replacers = { department: unit.department?.callsign, + callsign: unit.callsign, callsign1: unit.callsign, callsign2: unit.callsign2, division: division?.callsign,