Skip to content

Commit

Permalink
fix: 로그인 만료된 토큰 에러 처리
Browse files Browse the repository at this point in the history
  • Loading branch information
cys4585 committed Aug 22, 2024
1 parent 7ff7b91 commit db6db10
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion frontend/src/apis/gets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {

import ApiClient from './apiClient';
import { Filter } from '@_components/MyMoimListFilters/MyMoimListFilters';
import { ApiError } from '@_utils/customError/ApiError';

export const getMoims = async (): Promise<MoimInfo[]> => {
const response = await ApiClient.getWithLastDarakbangId('/moim');
Expand Down Expand Up @@ -165,7 +166,10 @@ export const getDarakbangInviteCode = async () => {
export const getDarakbangNameByCode = async (code: string) => {
const response = await ApiClient.getWithAuth(
'/darakbang/validation?code=' + code,
).catch(() => {
).catch((e) => {
if (e instanceof ApiError && e.status === 401) {
throw e;
}
return {
json: () => {
return { data: { name: '' } };
Expand Down

0 comments on commit db6db10

Please sign in to comment.