Skip to content
This repository was archived by the owner on Jul 11, 2026. It is now read-only.

refactor: posts#182

Merged
Dino0204 merged 93 commits into
developfrom
fix/client
Jul 7, 2025
Merged

refactor: posts#182
Dino0204 merged 93 commits into
developfrom
fix/client

Conversation

@Dino0204

@Dino0204 Dino0204 commented Jul 5, 2025

Copy link
Copy Markdown
Member

#️⃣연관된 이슈

ex) #이슈번호, #이슈번호

#180

📝작업 내용

이번 PR에서 작업한 내용을 간략히 설명해주세요(이미지 첨부 가능)

ScoreFormType

  • 교내인성영역관련수상
  • 교외인성영역관련수상
    -> 추가

SCORE_CATEGORIES
-> 다른 파일로 분리 및 교내외인성영역관련수상 카테고리 추가

Calculate
-> Page, View 분리

파일, 함수명 일관성 유지
send -> post
update -> patch
Book -> reading

타입가드 추가 및 사용
-> isActivity, isReading, isOthers, isDraft, isPost

에러 처리 일관성 유지
error as AxiosError -> isAxiosError(error)

Certification 타입명 변경
-> request, response

겹치는 파일, 타입, 안쓰는 타입 제거

evidenceMock 구조 실제 데이터와 일치하게 변경

signin, signup 타입 분리

write, edit에서 사용하는 configType 하나로 통일
-> major, humanities, reading, others

input 공통 컴포넌트 내의 email 제한 로직 삭제
-> react-hook-form 에러 메시지 사용하도록 변경
-> 의존성 주입을 통해 email 제한 로직을 추가하도록 하거나 해야 할 듯

💬리뷰 요구사항(선택)

리뷰어가 특별히 봐주었으면 하는 부분이 있다면 작성해주세요

post, draft type 처리 로직을 잘 살펴봐주세요.
새로고침 시 게시글의 내용물이 없어지는 문제가 있어서 새로고침을 못 하도록 막거나 refetch하는 로직을 추가해야 할 것 같은데 코멘트 꼭 달아주세요.

@snowykte0426
snowykte0426 requested a review from Copilot July 7, 2025 02:36

Copilot AI 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.

Pull Request Overview

This PR refactors how posts and drafts are handled across the codebase by introducing unified PostType/DraftType, updating type guards, centralizing category/config definitions, and overhauling form components to use React Hook Form and React Query consistently.

  • Introduce DraftType/PostType in types and update handlePost.ts guards
  • Extract and organize write/edit configurations and category options into separate modules
  • Refactor Input, WriteForm, and EditForm to leverage React Query mutations and unified callback patterns

Reviewed Changes

Copilot reviewed 85 out of 88 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/utils/src/handlePost.ts Added isDraft/isPost, updated type guards for unified PostType and DraftType
packages/types/src/evidences.ts Renamed types to PostType/PostResponse, updated status type
packages/shared/src/input.tsx Simplified Input component by removing custom email logic and using form errors
apps/client/src/widgets/write/ui/index.tsx Refactored WriteForm to use useMutation, unified draft/submit flows
apps/client/src/views/detail/index.tsx Updated DetailView to use context and React Query delete mutation
Comments suppressed due to low confidence (4)

apps/client/src/widgets/write/ui/index.tsx:84

  • [nitpick] Function names should use camelCase. Rename ChangeStatusDraft to handleSetDraftStatus (or similar) to follow project naming conventions and clarify its purpose.
  const ChangeStatusDraft = useCallback(() => {

packages/types/src/evidences.ts:48

  • The PostResponse interface is missing a property for other evidence (e.g., otherEvidence: Others[]) but code references otherEvidence in PostsWidget. Add that array to the type to match usage.
export interface PostResponse {

apps/client/src/views/detail/index.tsx:124

  • The handleModalOpen function is referenced here but no longer defined. Define it (e.g., const handleModalOpen = () => setModalOpen(true)) or update the onClick handler to use the correct function.
            onClick={handleModalOpen}

apps/client/src/widgets/write/model/writeConfig.ts:87

  • The onSubmit signature for the 'others' case no longer matches the expected (data, type) pattern used elsewhere. It should accept a second submitType parameter or the Config interface updated to match this implementation.
        onSubmit: async (data: FormValues) => {

@github-actions

github-actions Bot commented Jul 7, 2025

Copy link
Copy Markdown

✅ CI success

@bae080311 bae080311 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

로직을 좀 많이 깔끔하게 분리해야할거 같아요

Comment thread apps/admin/src/views/score/ui/scoreForm.tsx Outdated
Comment thread apps/client/src/entities/detail/api/deletePost.ts
Comment thread apps/client/src/entities/detail/api/deletePost.ts Outdated
Comment thread apps/client/src/widgets/posts/ui/index.tsx Outdated
Comment thread apps/client/src/shared/ui/post/index.tsx
@github-actions

github-actions Bot commented Jul 7, 2025

Copy link
Copy Markdown

✅ CI success

@github-actions

github-actions Bot commented Jul 7, 2025

Copy link
Copy Markdown

✅ CI success

@github-actions

github-actions Bot commented Jul 7, 2025

Copy link
Copy Markdown

✅ CI success

@Dino0204
Dino0204 requested a review from bae080311 July 7, 2025 08:54
@github-actions

github-actions Bot commented Jul 7, 2025

Copy link
Copy Markdown

✅ CI success

@Dino0204
Dino0204 merged commit 96b8d05 into develop Jul 7, 2025
2 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

🌟 Admin Admin 페이지와 관련된 이슈를 작성해주세요! 🐋 Client Client 페이지와 관련된 이슈를 작성해주세요! 🪽 Packages 공통 Packages와 관련된 이슈를 추가해주세요!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants