From fa6dd55ba0e4153036b1eae676c534f7a10bf361 Mon Sep 17 00:00:00 2001 From: Jonathan Bernard Date: Mon, 12 Aug 2024 15:47:52 -0500 Subject: [PATCH] api: Pass in the Notion Config DB ID (required for the new client). --- api/src/hff_entry_forms_api.nim | 1 + api/src/hff_entry_forms_apipkg/notion_client.nim | 2 +- api/src/hff_entry_forms_apipkg/service.nim | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/api/src/hff_entry_forms_api.nim b/api/src/hff_entry_forms_api.nim index c51a2dd..6ee6e1e 100644 --- a/api/src/hff_entry_forms_api.nim +++ b/api/src/hff_entry_forms_api.nim @@ -33,6 +33,7 @@ proc loadConfig(args: Table[string, docopt.Value]): HffEntryFormsApiConfig = knownOrigins: cfg.getVal("known-origins")[1..^2].split(',').mapIt(it[1..^2]), notionApiBaseUrl: cfg.getVal("notion-api-base-url"), notionVersion: cfg.getVal("notion-version"), + notionConfigDbId: cfg.getVal("notion-config-db-id"), port: parseInt(cfg.getVal("port", "8300"))) when isMainModule: diff --git a/api/src/hff_entry_forms_apipkg/notion_client.nim b/api/src/hff_entry_forms_apipkg/notion_client.nim index a3ad1af..d88223f 100644 --- a/api/src/hff_entry_forms_apipkg/notion_client.nim +++ b/api/src/hff_entry_forms_apipkg/notion_client.nim @@ -11,7 +11,7 @@ proc getNotionClient(cfg: HffEntryFormsApiConfig): NotionClient = notionClient = some(initNotionClient(NotionClientConfig( apiVersion: cfg.notionVersion, apiBaseUrl: cfg.notionApiBaseUrl, - configDbId: "", + configDbId: cfg.notionConfigDbId, integrationToken: cfg.integrationToken))) return notionClient.get diff --git a/api/src/hff_entry_forms_apipkg/service.nim b/api/src/hff_entry_forms_apipkg/service.nim index ec3063f..b45080b 100644 --- a/api/src/hff_entry_forms_apipkg/service.nim +++ b/api/src/hff_entry_forms_apipkg/service.nim @@ -12,6 +12,7 @@ type knownOrigins*: seq[string] notionApiBaseUrl*: string notionVersion*: string + notionConfigDbId*: string port*: int proc newApiError*(parent: ref Exception = nil, respCode: HttpCode, respMsg: string, msg = ""): ref ApiError =