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 }),