Skip to content

Commit

Permalink
chore: re-import createMetabaseClient after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
zz-hh-aa committed Dec 2, 2024
1 parent 97ee946 commit 1a4ca85
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions api.planx.uk/modules/analytics/metabase/collection/service.ts
Original file line number Diff line number Diff line change
@@ -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<boolean> {
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);
Expand Down Expand Up @@ -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,
Expand All @@ -62,7 +64,7 @@ export async function checkCollections(teamName: string): Promise<any> {
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) =>

Check warning on line 69 in api.planx.uk/modules/analytics/metabase/collection/service.ts

View workflow job for this annotation

GitHub Actions / Run API Tests

Unexpected any. Specify a different type
collection.name.toLowerCase().includes(teamName.toLowerCase()),
Expand Down

0 comments on commit 1a4ca85

Please sign in to comment.