From da87f60d6a1311014f24e2b2fdb9aa32fe3bfacd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=A9o=20M=C3=A9vollon?= Date: Wed, 17 Jan 2024 17:57:49 +0100 Subject: [PATCH] fix: revert debug commit This reverts commit 00febe6e6ade1c70c693a8cd2b458a06405c3326. --- src/hooks/use-users.ts | 15 +++++---------- src/utils/graphql-fetcher.ts | 5 +---- src/utils/log-action.ts | 2 +- 3 files changed, 7 insertions(+), 15 deletions(-) diff --git a/src/hooks/use-users.ts b/src/hooks/use-users.ts index 0ce89e46..515263db 100644 --- a/src/hooks/use-users.ts +++ b/src/hooks/use-users.ts @@ -14,7 +14,6 @@ import { } from "@/queries/index" import logAction from "@/utils/log-action" import { getSession } from "next-auth/react" -import logger from "@/utils/logger" interface UserMapping { name: string @@ -117,15 +116,11 @@ export const mergeUsers = async ( userToDrop: User ): Promise => { const session = await getSession() - try { - await logAction({ - action: "merge", - user: session?.user.login, - parameters: JSON.stringify({ userToKeep, userToDrop }), - }) - } catch (e) { - logger.error({ e }, "error inserting log") - } + logAction({ + action: "merge", + user: session?.user.login, + parameters: JSON.stringify({ userToKeep, userToDrop }), + }) await graphQLFetcher({ query: mergeUsersQuery, diff --git a/src/utils/graphql-fetcher.ts b/src/utils/graphql-fetcher.ts index 1539b61f..ed1f0a2e 100644 --- a/src/utils/graphql-fetcher.ts +++ b/src/utils/graphql-fetcher.ts @@ -1,6 +1,5 @@ import { GraphQLClient } from "graphql-request" import { NEXT_PUBLIC_HASURA_URL } from "./env" -import logger from "./logger" export interface GraphQLFetcherParams { query: string @@ -32,9 +31,7 @@ const graphQLFetcher = ({ } } - const using_url = url || NEXT_PUBLIC_HASURA_URL - const client = new GraphQLClient(using_url, options) - logger.info({ using_url }) + const client = new GraphQLClient(url || NEXT_PUBLIC_HASURA_URL, options) return client.request(query, parameters) } diff --git a/src/utils/log-action.ts b/src/utils/log-action.ts index 24289733..f148d469 100644 --- a/src/utils/log-action.ts +++ b/src/utils/log-action.ts @@ -15,7 +15,7 @@ const logAction = ({ parameters, token, }: LogActionParameters) => { - return graphQLServiceFetcher({ + graphQLServiceFetcher({ query: insertLog, ...(token && { token, includeCookie: false }), ...(!token && { includeCookie: true }),