Skip to content

Commit

Permalink
fix: revert debug commit
Browse files Browse the repository at this point in the history
This reverts commit 00febe6.
  • Loading branch information
matmut7 committed Jan 17, 2024
1 parent 9e519cb commit da87f60
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 15 deletions.
15 changes: 5 additions & 10 deletions src/hooks/use-users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -117,15 +116,11 @@ export const mergeUsers = async (
userToDrop: User
): Promise<User> => {
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,
Expand Down
5 changes: 1 addition & 4 deletions src/utils/graphql-fetcher.ts
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion src/utils/log-action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const logAction = ({
parameters,
token,
}: LogActionParameters) => {
return graphQLServiceFetcher({
graphQLServiceFetcher({
query: insertLog,
...(token && { token, includeCookie: false }),
...(!token && { includeCookie: true }),
Expand Down

0 comments on commit da87f60

Please sign in to comment.