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

Pending 이슈 해결 #180

Merged
merged 1 commit into from
Jun 12, 2022
Merged

Pending 이슈 해결 #180

merged 1 commit into from
Jun 12, 2022

Conversation

yesjjin99
Copy link
Collaborator

@yesjjin99 yesjjin99 commented Jun 11, 2022

  • 작업하면서 확인되는 Cannot set headers after they are sent to the client 에러나 비로그인 상태일 때 응답이 아예 안오는 케이스들 수정했습니다
  • 알림 생성 시 알림을 보낼 USER_ID를 받아올 때 동작 안되는 부분들이 발견되어 모두 수정했습니다
  • 스터디 디테일, 수정, 삭제, 마감하기에 403 에러 처리하는 부분을 추가해놓은 상태입니다. 이 부분도 프론트 대응이 필요하지 않을까 싶어서 머지 되는대로 이슈 올리겠습니다

@yesjjin99 yesjjin99 linked an issue Jun 11, 2022 that may be closed by this pull request
title: '모집 종료',
about: `모집이 종료되었어요. 스터디를 응원합니다!`,
about: `모집이 종료되었어요. ${member.USER_ID}님의 스터디를 응원합니다!`,
Copy link
Contributor

Choose a reason for hiding this comment

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

이거 userid값이면 uuid값 아닌가요?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

앗 USER_NAME 이 맞습니다ㅋㅋㅋㅋㅋ 수정했습니다 🙏

if (req.body.dueDate) {
const due = new Date(req.body.dueDate);
const now = new Date();

if (due.toISOString().split('T')[0] < now.toISOString().split('T')[0]) {
if (due.toISOString().split('T')[0] < now.toISOString().split('T')[0])
Copy link
Contributor

Choose a reason for hiding this comment

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

date-fns나 dayjs 같은 날짜 관련 라이브러리 사용하는 것도 좋아 보입니다!
중요도 높은 건 아니라 다음 번에 고려해주셔도 될 듯 합니다 :)


await studyService.updateStudy(
{
title: req.body.title ? req.body.title : study.title,
Copy link
Contributor

Choose a reason for hiding this comment

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

??나 || 연산자로도 대체될 수 있을 것 같아요!

Comment on lines +181 to +186
return await getRepository(Study)
.createQueryBuilder()
.update()
.set(studyDTO)
.where('id = :studyId', { studyId })
.execute();
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 +27 to +32
export const findAllStudyUserByStudyId = async (studyId: string) => {
return await getRepository(StudyUser)
.createQueryBuilder()
.select()
.where('STUDY_ID = :id', { id: studyId })
.execute();
.createQueryBuilder('studyUser')
.select('studyUser.USER_ID')
.where('studyUser.STUDY_ID = :studyId', { studyId })
.getMany();
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

@yesjjin99 yesjjin99 Jun 12, 2022

Choose a reason for hiding this comment

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

기존에 위 로직이 사용되던 부분들은 모두 수정해놓은 상태입니다!

Comment on lines +439 to +457
const study = await getRepository(Study)
.createQueryBuilder('study')
.addSelect('study.dueDate')
.leftJoinAndSelect('study.hostId', 'UserProfile')
.where('study.id = :id', { id: studyid })
.getOne();

expect(study?.title).toEqual('STUDY TITLE');
expect(study?.studyAbout).toEqual('STUDY ABOUT');
expect(study?.weekday).toEqual(
expect.arrayContaining([WeekDayEnum.WED, WeekDayEnum.THU])
);
expect(study?.frequency).toEqual(FrequencyEnum.MORE);
expect(study?.location).toEqual(
expect.arrayContaining([LocationEnum.LIBRARY, LocationEnum.NO_CONTACT])
);

expect(study?.capacity).toEqual(8);
expect(study?.categoryCode).toEqual(101);
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

@rudy3091 rudy3091 left a comment

Choose a reason for hiding this comment

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

고생하셨습니다!

@yesjjin99 yesjjin99 force-pushed the hotfix/study-detail branch from 57f9df4 to 6b4d66c Compare June 12, 2022 17:54
@yesjjin99 yesjjin99 merged commit b5f31b8 into develop Jun 12, 2022
@yesjjin99 yesjjin99 deleted the hotfix/study-detail branch June 12, 2022 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pending 이슈 발생케이스
3 participants