api: Pass in the Notion Config DB ID (required for the new client).

This commit is contained in:
Jonathan Bernard 2024-08-12 15:47:52 -05:00
parent 2dda8ebd76
commit fa6dd55ba0
3 changed files with 3 additions and 1 deletions

View File

@ -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:

View File

@ -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

View File

@ -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 =