Skip to content

✨ feat: add api for update emoji(group) and update api and update interface - #34

Open
j2woo wants to merge 5 commits into
mainfrom
2-add-group-updateEmoji
Open

j2woo wants to merge 5 commits into
mainfrom
2-add-group-updateEmoji

Conversation

@j2woo

@j2woo j2woo commented Jan 23, 2023

Copy link
Copy Markdown
Member

그룹 포스트 이모지 수정

- 이모지를 수정에 성공하면 JSON으로 수정 결과와 포스트 디테일 정보를 넘겨준다.

스크린샷 2023-01-23 오후 2 27 44

😀 이모지 사용

스크린샷 2023-01-27 오후 12 30 11

스크린샷 2023-01-27 오후 12 29 49

- 수정 실패 시 에러

image

위와 같이 포스트를 수정했을 때도 바꿔줌( 수정 후 포스트 디테일 정보 JSON으로 넘겨주기, 수정 실패시 에러)

스크린샷 2023-01-23 오후 2 41 04

인터페이스에서 snake -> camel로 수정

image


추가로 수정해야 할 부분: 개인 포스트 수정, 개인 포스트 이모지 수정 추가

@j2woo j2woo self-assigned this Jan 23, 2023
@j2woo j2woo added ✨ Feature 기능 개발 📚 DB 데이터베이스 📬 API 서버 API 통신 🔰BE BE labels Jan 23, 2023
@j2woo j2woo added this to the Sprint 5 milestone Jan 23, 2023

@Hyyena Hyyena left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

코멘트 확인 부탁드립니당🙏

req.body as GroupPostInputDTO,
);
// 수정한 포스트 결과
return res.status(201).json({ result: groupUpdatedPostResult, post: groupPostDetail});

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

응답 시 result에 배열을 그대로 담아서 주는데, true or false값만 전달해주는게 어떤가요?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

groupUpdatedPostResult와 groupPostDetail 차이점이 뭔가요? 좀 헷갈려서..

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

groupUp0datedPostResult는 수정 성공 여부이고 groupPostDetail은 수정 후 포스트의 정보를 전달하기 위한 해당 포스트의 디테일 정보입니다.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

result에 true false 값으로 수정하겠습니다.

Comment thread src/services/group.ts
);
// 비로그인 회원은 필요한 거- 비밀번호 확인

if (groupUpdatedPostResult[0]===0) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sequelize UPDATE 시 return type이 [영향 받은 행 개수]니까 업데이트 수행 시 리턴값이 [0]이면 업데이트 할 포스트가 없다고 보고 이러한 조건식을 걸어두신건가요?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Comment thread src/api/routes/v1/group.ts Outdated
export default (app: Router) => {
app.use("/groups", route);

// 개인 롤링페이퍼 포스트 생성

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

주석 개인 -> 그룹 수정해야될거같습니다😅

req.body as GroupPostInputDTO,
);
// 수정한 포스트 결과
return res.status(201).json({ result: groupUpdatedPostResult, post: groupPostDetail});

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

groupUpdatedPostResult와 groupPostDetail 차이점이 뭔가요? 좀 헷갈려서..

@Hyyena

Hyyena commented Jan 26, 2023

Copy link
Copy Markdown
Contributor

API 테스트 시 emojiType에 문자열 말고, 😀와 같은 이모지도 넣어서 테스트 해주시면 감사하겠습니다.

그리고, body에 담아 보내는 JSON도 camelCase로 수정해야할 것 같습니다!

@j2woo j2woo closed this Jan 27, 2023
@j2woo j2woo reopened this Jan 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📬 API 서버 API 통신 🔰BE BE 📚 DB 데이터베이스 ✨ Feature 기능 개발

Projects

No open projects
Status: 🏗 In progress

Development

Successfully merging this pull request may close these issues.

3 participants