From 1a4ca85d81f89284896db0e16ca757ed823093c5 Mon Sep 17 00:00:00 2001 From: zz-hh-aa Date: Mon, 2 Dec 2024 14:31:08 +0000 Subject: [PATCH] chore: re-import createMetabaseClient after rebase --- .../modules/analytics/metabase/collection/service.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/api.planx.uk/modules/analytics/metabase/collection/service.ts b/api.planx.uk/modules/analytics/metabase/collection/service.ts index 49d6301ada..d9bd0856e0 100644 --- a/api.planx.uk/modules/analytics/metabase/collection/service.ts +++ b/api.planx.uk/modules/analytics/metabase/collection/service.ts @@ -1,10 +1,12 @@ -import { MetabaseError, metabaseClient } from "../shared/client.js"; +import { MetabaseError, createMetabaseClient } from "../shared/client.js"; import type { NewCollectionParams } from "./types.js"; import { toSnakeCase } from "../shared/utils.js"; +const client = createMetabaseClient(); + export async function authentication(): Promise { try { - const response = await metabaseClient.get("/user/current"); + const response = await client.get("/user/current"); return response.status === 200; } catch (error) { console.error("Error testing Metabase connection:", error); @@ -39,7 +41,7 @@ export async function newCollection({ (key) => requestBody[key] === undefined && delete requestBody[key], ); - const response = await metabaseClient.post(`/api/collection/`, { + const response = await client.post(`/api/collection/`, { name, description, parent_id, @@ -62,7 +64,7 @@ export async function checkCollections(teamName: string): Promise { console.log("Checking for collection: ", teamName); // Get collections from Metabase - const response = await metabaseClient.get(`/api/collection/`); + const response = await client.get(`/api/collection/`); const matchingCollection = response.data.find((collection: any) => collection.name.toLowerCase().includes(teamName.toLowerCase()),