Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FE] issue137: 리뷰 작성 페이지 생성 #184

Merged
merged 45 commits into from
Aug 3, 2022
Merged

Conversation

airman5573
Copy link
Collaborator

요약

  • 리뷰 작성 페이지를 생성했습니다
  • StudyRoom에 리뷰 작성 페이지(TabPanel)을 붙였습니다
  • 리뷰 작성 / 수정 / 삭제 기능을 구현했습니다. 다만, Backend API가 아직 없는 관계로 정상 작동하지는 않습니다.

close #137

@airman5573 airman5573 added 🚀 feature New feature or request 😁 frontend New frontend feature labels Aug 1, 2022
@airman5573 airman5573 requested a review from nan-noo August 1, 2022 13:35
@airman5573 airman5573 self-assigned this Aug 1, 2022
@@ -1,4 +1,4 @@
import { StudyDetail } from '@custom-types/index';
import { StudyDetail } from '@custom-types';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment on lines 5 to 6
export const patchReview = async ({ studyId, reviewId, content }: EditReviewQueryData) => {
const response = await axiosInstance.patch<EmptyObject, any, EditReviewQueryData>(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

import axiosInstance from '@api/axiosInstance';

export const postReview = async ({ studyId, content }: ReviewQueryData) => {
const response = await axiosInstance.post<EmptyObject, any, { content: string }>(`/api/studies/${studyId}/reviews`, {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

회의결과 any대신 AxiosResponse을 넣어주기로 했습니다

@@ -1,17 +1,18 @@
import { noop } from '@utils/index';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

얘도 index 없애면 좋을 것 같아요!

import { css } from '@emotion/react';
import styled from '@emotion/styled';

export const KebabMenu = styled.ul`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이름이 아주 적절하군요 :D

Comment on lines +20 to +24
export type StudyId = number;
export type TagId = number;
export type ReviewId = number;
export type MemberId = number;
export type CategoryId = number;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@@ -89,6 +89,6 @@ export const handlers = [
}),
...detailStudyHandlers,
...tagHandlers,
...tokenHandlers,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이거 지우면 로그인 모킹서버가 안 돼요!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

복구했습니다!

Comment on lines 1 to 12
import { rest } from 'msw';

export const tokenHandlers = [
rest.post('/api/login/token', (req, res, ctx) => {
const code = req.url.searchParams.get('code');

if (!code) {
return res(ctx.status(400), ctx.json({ message: '잘못된 요청입니다.' }));
}
return res(ctx.status(200), ctx.json({ token: 'asddfasdfassdf' }));
}),
];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

복구해주세요!!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

네!

export type DD = `0${oneToNine}` | `1${d}` | `2${d}` | `3${0 | 1}`;
export type MM = `0${oneToNine}` | `1${0 | 1 | 2}`;
export type YYYY = `20${d}${d}`;
export type DateYMD = `${YYYY}-${MM}-${DD}`;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👀 👍

ctx.status(200),
ctx.json({
reviews: reviewJSON.reviews.slice(0, sizeNum),
totalResults: reviewJSON.reviews.length,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이거 totalResults -> totalCount로 바꿔주세요!

airman5573 and others added 15 commits August 2, 2022 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚀 feature New feature or request 😁 frontend New frontend feature
Projects
None yet
2 participants