Skip to content

Commit

Permalink
fix: lint 에러 수정 (#101)
Browse files Browse the repository at this point in the history
- 사용하지 않는 error 변수의 에러 메시지를 토스트에 추가
- base_url의 논리 연산자 수정
  • Loading branch information
dooohun authored Nov 21, 2024
1 parent f32c48f commit 5ed80a8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion packages/client/src/pages/quiz-wait/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ export default function QuizWait() {
navigator.clipboard.writeText(guestLink);
toast.success('링크가 복사되었습니다.');
} catch (error) {
toast.error('링크 복사에 실패했습니다.');
if (error instanceof Error) {
const errorMessage = error.message;
toast.error(errorMessage);
}
}
};

Expand Down
4 changes: 3 additions & 1 deletion packages/client/src/shared/api/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// TODO: env 파일로 관리하기
const BASE_URL = `${import.meta.env.VITE_SERVER_URL}/api` || 'http://localhost:3000/api';
const BASE_URL = import.meta.env.VITE_SERVER_URL
? `${import.meta.env.VITE_SERVER_URL}/api`
: 'http://localhost:3000/api';

interface FetchOptions extends Omit<RequestInit, 'body'> {
headers?: Record<string, string>;
Expand Down

0 comments on commit 5ed80a8

Please sign in to comment.