Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
dca90d6
feat: 임시저장된 편지 삭제 기능 구현 (#84)
tifsy Mar 7, 2025
70051d3
feat: 롤링페이퍼 배포된 api로 연결 수정 (#85)
AAminha Mar 7, 2025
aeab0e6
feat : 알림 2차 기능 구현 (#81)
wldnjs990 Mar 7, 2025
ae17500
fix: 자잘한 이슈 수정 (#86)
nirii00 Mar 7, 2025
62d67cd
feat : 재사용 가능한 페이지네이션 구현 (#92)
wldnjs990 Mar 7, 2025
266d0e5
feat: 편지 공유 요청 수신 조회 기능 구현 (#90)
tifsy Mar 7, 2025
a0f576b
feat : 편지작성, 랜덤편지, 상세페이지 3차 기능구현 (#94)
wldnjs990 Mar 8, 2025
5b4d4ba
feat: 롤링페이퍼 추가 기능 구현 (#95)
AAminha Mar 9, 2025
f0b5b4f
feat: 임시저장 편지 조회 기능 완성 (#97)
tifsy Mar 9, 2025
4aced28
feat : 토스트 UI 구현 + 알림 페이지 코드 작업 90% 완료 + 실시간 알림, 편지 작성 예외처리에 토스트UI 연결…
wldnjs990 Mar 9, 2025
6917b3b
fix: reissue 문제, 내 편지함 data 최신화 문제 해결 (#100)
nirii00 Mar 9, 2025
a8144d5
feat : 알림 페이지 알림 확인 처리 안되던 현상 수정 + 신고페이지 4차 구현 (#101)
wldnjs990 Mar 9, 2025
58df399
feat: 공유 요청 상세 조회 기능 구현 (#106)
tifsy Mar 10, 2025
74ef07b
fix: 임시저장 편지 작성 페이지 이동 경로 문제 해결 (#109)
tifsy Mar 10, 2025
6059368
feat : 신고 등록 API + ReportModal 수정 (#111)
wldnjs990 Mar 10, 2025
2fb1cc6
fix: QA 반영 (#112)
nirii00 Mar 10, 2025
40c2021
feat : 알림 기능 구현 + QA (#114)
wldnjs990 Mar 10, 2025
f55da9f
feat : 임시저장 데이터 바인딩 및 임시저장 덮어씌우기 작업 완료 (#115)
wldnjs990 Mar 10, 2025
5fd9543
refactor: 2차 QA 반영 (#116)
tifsy Mar 10, 2025
b33b576
fix: 롤링페이퍼 QA 반영 (#120)
AAminha Mar 10, 2025
65f982b
feat : 알림 QA 수정 (#124)
wldnjs990 Mar 10, 2025
a441bd7
deploy : 배포 (#126)
wldnjs990 Mar 10, 2025
a1f9e59
fix: 3차 QA 반영 (#131)
nirii00 Mar 11, 2025
e2d90da
feat: 다크모드 구현 (#132)
nirii00 Mar 11, 2025
f748ef3
fix: 3차 QA 반영 (#133)
tifsy Mar 11, 2025
3b83467
feat : QA반영 (#134)
wldnjs990 Mar 11, 2025
561a24a
feat : 금칙어 수정, 활성/비활성, 삭제 api 연결 완료 (#141)
wldnjs990 Mar 11, 2025
90282b6
fix: 4차 QA 반영 (#143)
tifsy Mar 11, 2025
e8a9021
fix: 4차 QA 반영, 버그 수정 - 세빈 (#144)
nirii00 Mar 11, 2025
a19e460
deploy : 5차 배포 (#146)
wldnjs990 Mar 12, 2025
ecab9ae
fix : api reissue 오류 수정 (#152)
wldnjs990 Mar 13, 2025
d67369b
refactor: 코드 정리 (#156)
tifsy Mar 13, 2025
7607f68
Merge branch 'main' of https://github.com/prgrms-web-devcourse-final-…
wldnjs990 Mar 13, 2025
dbf33e2
fix : console.log 남아있는 것들 제거
wldnjs990 Mar 13, 2025
a69b9af
refactor : 편지 공유요청 승인시 트스트UI 제거
wldnjs990 Mar 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import Layout from './layouts/Layout';
import MobileLayout from './layouts/MobileLayout';
import PrivateRoute from './layouts/PrivateRoute';
import AdminPage from './pages/Admin';
import FilteredLetterManage from './pages/Admin/FilteredLetter';
import FilteringManage from './pages/Admin/Filtering';
import ReportManage from './pages/Admin/Report';
import AdminRollingPaper from './pages/Admin/RollingPaper';
Expand Down Expand Up @@ -84,7 +83,6 @@ const App = () => {
<Route path="admin" element={<AdminPage />}>
<Route path="report" element={<ReportManage />} />
<Route path="badwords" element={<FilteringManage />} />
<Route path="filtered-letter" element={<FilteredLetterManage />} />
<Route path="rolling-paper" element={<AdminRollingPaper />} />
</Route>
</Route>
Expand Down
9 changes: 1 addition & 8 deletions src/apis/admin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ const getReports = async (reportQueryString: ReportQueryString) => {
const queryStrings = queryParams.toString();
const res = await client.get(`/api/reports?${queryStrings}`);
if (!res) throw new Error('신고 목록 데이터 조회 도중 에러가 발생했습니다.');
console.log(res);
return res;
} catch (error) {
console.error(error);
Expand All @@ -32,9 +31,8 @@ const getReports = async (reportQueryString: ReportQueryString) => {

const patchReport = async (reportId: number, patchReportRequest: PatchReportRequest) => {
try {
console.log(`/api/reports/${reportId}`, patchReportRequest);
const res = await client.patch(`/api/reports/${reportId}`, patchReportRequest);
console.log(res);
return res;
} catch (error) {
console.error(error);
}
Expand All @@ -45,7 +43,6 @@ const getBadWords = async () => {
try {
const res = await client.get('/api/bad-words');
if (!res) throw new Error('금칙어 조회 도중 에러가 발생했습니다.');
console.log(res);
return res;
} catch (error) {
console.error(error);
Expand All @@ -55,7 +52,6 @@ const getBadWords = async () => {
const postBadWords = async (badWordsRequest: BadWords) => {
try {
const res = await client.post('/api/bad-words', badWordsRequest);
console.log(res);
if (!res) throw new Error('금칙어 등록 도중 에러가 발생했습니다.');
return res;
} catch (error) {
Expand All @@ -69,7 +65,6 @@ const patchBadWordsUsed = async (badWordId: string, isUsed: string) => {
try {
const res = await client.patch(`/api/bad-words/${badWordId}/status`, { isUsed: reverseIsUsed });
if (!res) throw new Error('검열 활성화/비활성화 도중 에러가 발생했습니다.');
console.log(res);
return res;
} catch (error) {
console.error(error);
Expand All @@ -80,7 +75,6 @@ const patchBadWords = async (badWordId: string, word: string) => {
try {
const res = await client.patch(`/api/bad-words/${badWordId}`, { word: word });
if (!res) throw new Error('금칙어 수정중 에러가 발생했습니다.');
console.log(res);
return res;
} catch (error) {
console.error(error);
Expand All @@ -91,7 +85,6 @@ const deleteBadWords = async (id: string) => {
try {
const res = await client.delete(`/api/bad-words/${id}`);
if (!res) throw new Error('금칙어 삭제 도중 에러가 발생했습니다.');
console.log(res);
return res;
} catch (error) {
console.error(error);
Expand Down
6 changes: 0 additions & 6 deletions src/apis/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ export const getNewToken = async () => {
try {
const response = await client.post('/api/reissue', {}, { withCredentials: true });
if (!response) throw new Error('getNewToken: no response data');
console.log(response.data);
return response;
} catch (error) {
console.error(error);
Expand Down Expand Up @@ -64,15 +63,10 @@ export const deleteUserInfo = async () => {

export const postLogout = async () => {
try {
console.log(' before logout');

const response = await client.post('/api/logout', { withCredentials: true });
console.log('logout', response);
if (!response) throw new Error('postLogout: failed to logout');
return response;
} catch (error) {
console.log('logout error');

console.error(error);
}
};
1 change: 0 additions & 1 deletion src/apis/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ client.interceptors.request.use(
const accessToken = useAuthStore.getState().accessToken;
if (config.url !== '/api/reissue' && accessToken) {
config.headers.Authorization = `Bearer ${accessToken}`;
console.log('interceptor', config);
}
return config;
},
Expand Down
2 changes: 0 additions & 2 deletions src/apis/draftLetters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ export interface DraftLetter {
export const getDraftLetters = async (): Promise<DraftLetter[]> => {
try {
const { data } = await client.get('/api/letters?status=draft');
console.log('임시저장된 편지 데이터', data);
return data.data;
} catch (error) {
console.error('❌임시저장된 편지를 불러오던 중 에러가 발생했습니다', error);
Expand All @@ -28,7 +27,6 @@ export const deleteDraftLetters = async (letterId: number) => {
const { data } = await client.delete(`/api/letters/${letterId}/temporary-save`);

if (data.data?.letterId) {
console.log('삭제된 임시저장 편지 ID:', data.data.letterId);
} else {
console.error('❌서버 응답에 letterId가 존재하지 않습니다.');
}
Expand Down
1 change: 0 additions & 1 deletion src/apis/incomingLetters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import client from './client';
export const getIncomingLetters = async () => {
try {
const { data } = await client.get('/api/letters?status=delivery');
console.log('오고있는 편지 데이터', data);
return data;
} catch (error) {
console.error('❌오고 있는 편지 목록을 불러오던 중 에러 발생', error);
Expand Down
4 changes: 0 additions & 4 deletions src/apis/letterDetail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ const getLetter = async (letterId: string) => {
try {
const res = await client.get(`/api/letters/${letterId}`);
if (!res) throw new Error('편지 데이터를 가져오는 도중 에러가 발생했습니다.');
console.log(res);
return res;
} catch (error) {
console.error(error);
Expand All @@ -13,10 +12,8 @@ const getLetter = async (letterId: string) => {

const deleteLetter = async (letterId: string) => {
try {
console.log(`/api/letters/${letterId}`);
const res = await client.delete(`/api/letters/${letterId}`);
if (!res) throw new Error('편지 삭제 요청 도중 에러가 발생했습니다.');
console.log(res);
return res;
} catch (error) {
console.error(error);
Expand All @@ -29,7 +26,6 @@ const postEvaluateLetter = async (letterId: number, evaluation: LetterEvaluation
evaluation: evaluation,
});
if (!res) throw new Error('편지 삭제 요청 도중 에러가 발생했습니다.');
console.log(res);
return res;
} catch (error) {
console.error(error);
Expand Down
1 change: 0 additions & 1 deletion src/apis/mailBox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ export const getMailbox = async () => {
export const getMailboxDetail = async (id: number, pageParam: number) => {
try {
const response = await client.get(`/api/mailbox/${id}/detail?page=${pageParam}&size=20`);
console.log(response.data);
if (!response) throw new Error('error while fetching mailbox detail data');
return response.data;
} catch (error) {
Expand Down
2 changes: 0 additions & 2 deletions src/apis/notification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ const getTimeLines = async () => {
try {
const res = await client.get('/api/timelines');
if (!res) throw new Error('타임라인을 받아오는 도중 오류가 발생했습니다.');
console.log(res);
return res;
} catch (error) {
console.error(error);
Expand Down Expand Up @@ -35,7 +34,6 @@ const getNotReadCount = async () => {
try {
const res = await client.get('/api/notifications/not-read');
if (!res) throw new Error('안 읽은 알림 수를 가져오는 도중 오류가 발생했습니다.');
console.log(res);
return res;
} catch (error) {
console.error(error);
Expand Down
2 changes: 1 addition & 1 deletion src/apis/randomLetter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const deleteRandomLetterMatching = async () => {
if (!res) throw new Error('매칭 취소 도중 에러가 발생했습니다.');
return res;
} catch (error) {
console.log(error);
throw error;
}
};

Expand Down
2 changes: 0 additions & 2 deletions src/apis/rolling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export const getRollingPaperDetail = async (
size,
},
});
console.log(data);
return data;
};

Expand Down Expand Up @@ -92,7 +91,6 @@ export const patchRollingPaper = async (eventPostId: number | string) => {
const {
data: { data },
} = await client.patch(`/api/admin/event-posts/${eventPostId}/status`);
console.log(data);
return data;
} catch (error) {
console.error(error);
Expand Down
4 changes: 0 additions & 4 deletions src/apis/share.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ export const getSharePostList = async (page: number = 1, size: number = 10) => {
const response = await client.get('/api/share-posts', {
params: { page, size },
});
console.log(`🌟공유 게시글 목록`, response.data.data);

return response.data.data;
} catch (error) {
Expand All @@ -83,7 +82,6 @@ export const getSharePostList = async (page: number = 1, size: number = 10) => {
export const getSharePostDetail = async (sharePostId: string): Promise<SharePost> => {
try {
const response = await client.get(`/api/share-posts/${sharePostId}`);
console.log(`🔥공유 게시글 상세 데이터`, response.data);
return response.data.data;
} catch (error) {
console.error('❌ 편지 공유 게시글을 상세 조회하던 중 에러가 발생했습니다', error);
Expand Down Expand Up @@ -115,7 +113,6 @@ export const postShareProposals = async (
export const getShareProposalList = async () => {
try {
const response = await client.get('/api/share-proposals/inbox');
console.log(`🌟공유 요청 목록`, response.data);

return response.data.data;
} catch (error) {
Expand All @@ -130,7 +127,6 @@ export const getShareProposalDetail = async (
): Promise<ShareProposalDetail> => {
try {
const response = await client.get(`/api/share-proposals/${shareProposalId}`);
console.log(`😎공유 요청 상세 조회 데이터 `, response.data);
return response.data.data;
} catch (error) {
console.error('❌ 편지 공유 요청을 상세 조회하던 중 에러가 발생했습니다', error);
Expand Down
1 change: 0 additions & 1 deletion src/apis/unreadLetters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import client from './client';
export const getUnreadLettersCount = async (): Promise<UnreadLetters> => {
try {
const response = await client.get('/api/letters/unread/count');
console.log('📩 안 읽은 편지 개수 데이터', response);
return response.data;
} catch (error) {
console.error('❌안 읽은 편지 개수를 받아오던 중 에러가 발생했습니다', error);
Expand Down
3 changes: 0 additions & 3 deletions src/apis/write.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import client from './client';

const postLetter = async (data: LetterRequest) => {
console.log('request', data);
try {
const res = await client.post('/api/letters', data);
if (!res) throw new Error('편지 전송과정에서 오류가 발생했습니다.');
Expand All @@ -14,7 +13,6 @@ const postLetter = async (data: LetterRequest) => {
};

const postFirstReply = async (data: FirstReplyRequest) => {
console.log('Firstrequest', data);
try {
const res = await client.post('/api/random-letters/matching', data);
if (!res) throw new Error('최초 답장 전송과정에서 오류가 발생했습니다.');
Expand Down Expand Up @@ -45,7 +43,6 @@ const postTemporarySave = async (data: TemporaryRequest) => {
};

const postTemporaryLetter = async (data: TemporaryRequest) => {
console.log('Temporary request', data);
try {
const res = await client.post('/api/letters', data);
if (!res) throw new Error('편지 전송과정에서 오류가 발생했습니다.');
Expand Down
4 changes: 4 additions & 0 deletions src/components/MenuButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export default function MenuButton() {
: 'pointer-events-none translate-y-[120%] rotate-180 opacity-0',
)}
onClick={() => setIsOpen(false)}
aria-label="내 편지함으로 이동하기"
>
<MarkunreadOutlinedIcon fontSize="small" />
</Link>
Expand All @@ -34,6 +35,7 @@ export default function MenuButton() {
: 'pointer-events-none translate-y-[120%] rotate-180 opacity-0',
)}
onClick={() => setIsOpen(false)}
aria-label="게시판으로 이동하기"
>
<CalendarTodayOutlinedIcon fontSize="small" />
</Link>
Expand All @@ -46,6 +48,7 @@ export default function MenuButton() {
: 'pointer-events-none translate-y-[120%] rotate-180 opacity-0',
)}
onClick={() => setIsOpen(false)}
aria-label="속마음 나누기로 이동하기"
>
<EditNoteRoundedIcon fontSize="medium" />
</Link>
Expand All @@ -56,6 +59,7 @@ export default function MenuButton() {
isOpen ? 'rotate-90' : 'rotate-0',
)}
onClick={() => setIsOpen((state) => !state)}
aria-label="메뉴 열기"
>
<MenuRoundedIcon />
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/NotificationButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default function NotificationButton() {
});

return (
<Link to="/mypage/notifications" className="relative">
<Link to="/mypage/notifications" className="relative" aria-label="알림">
{notReadCount > 0 && (
<div className={notReadStyle}>{notReadCount < 100 ? notReadCount : '99+'}</div>
)}
Expand Down
1 change: 0 additions & 1 deletion src/components/ReportModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ const ReportModal = ({ reportType, letterId, onClose }: ReportModalProps) => {
const res = await postReports(postReportRequest);
if (res?.status === 200) {
setToastActive({ title: '신고가 접수되었습니다.', toastType: 'Success' });
console.log(res);
onClose();
} else {
setToastActive({ title: '신고한 이력이 있습니다.', toastType: 'Error' });
Expand Down
2 changes: 1 addition & 1 deletion src/components/ResultLetter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default function ResultLetter({
const today = `${date.getFullYear()}년 ${date.getMonth() + 1}월 ${date.getDate()}일`;

return (
<LetterWrapper className="min-w-[300px]">
<LetterWrapper className="w-[300px]">
<div className="flex w-full flex-col gap-[35px]">
<div className="flex justify-between gap-3">
<div className="flex flex-col gap-2.5">
Expand Down
12 changes: 2 additions & 10 deletions src/hooks/useServerSentEvents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,13 @@ export const useServerSentEvents = () => {

useEffect(() => {
if (!accessToken) {
// console.log('로그인 정보 확인불가');
return;
}

const connectSSE = () => {
const accessToken = useAuthStore.getState().accessToken;

try {
// console.log('구독 시작');
sourceRef.current = new EventSourcePolyfill(
`${import.meta.env.VITE_API_URL}/api/notifications/sub`,
{
Expand All @@ -60,19 +58,16 @@ export const useServerSentEvents = () => {
);

sourceRef.current.onmessage = (event) => {
// console.log(event);
// console.log('알림 수신');
handleOnMessage(event.data);
};

sourceRef.current.onerror = async (event) => {
console.log(event);
const errorEvent = event as unknown as { status?: number };
if (errorEvent.status === 401) {
try {
await useAuthStore.getState().refreshToken();
} catch (error) {
console.log('다른 api에서 리프레시 토큰 호출중입니다.');
throw error;
}
closeSSE();
reconnect = setTimeout(connectSSE, 5000);
Expand All @@ -82,14 +77,13 @@ export const useServerSentEvents = () => {
}
};
} catch (error) {
console.log('catch문에서 에러 발생', error);
throw error;
}
};

connectSSE();

return () => {
// console.log('컴포넌트 언마운트로 인한 구독해제');
closeSSE();
};
}, [accessToken]);
Expand All @@ -99,6 +93,4 @@ export const useServerSentEvents = () => {
sourceRef.current?.close();
sourceRef.current = null;
};

// return { closeSSE };
};
Loading