Skip to content

Commit

Permalink
chore(ghService): use existing axios util
Browse files Browse the repository at this point in the history
  • Loading branch information
kishore03109 committed Oct 18, 2023
1 parent ad0ee4c commit d8fbca9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/services/db/GitHubService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { ConflictError, inputNameConflictErrorMsg } from "@errors/ConflictError"
import { NotFoundError } from "@errors/NotFoundError"
import { UnprocessableError } from "@errors/UnprocessableError"

import { validateStatus } from "@utils/axios-utils"
import { isAxiosError, validateStatus } from "@utils/axios-utils"

import GithubSessionData from "@root/classes/GithubSessionData"
import UserWithSiteSessionData from "@root/classes/UserWithSiteSessionData"
Expand Down Expand Up @@ -646,7 +646,7 @@ export default class GitHubService {
)
return okAsync(null)
} catch (error) {
if (error instanceof AxiosError && error.response) {
if (isAxiosError(error) && error.response) {
const { status } = error.response
// If user is unauthorized or site does not exist, show the same NotFoundError
if (status === 404 || status === 403) {
Expand Down

0 comments on commit d8fbca9

Please sign in to comment.