[feat/MAT-591] study handwriting snapshot API hook 추가#289
Open
b0nsu wants to merge 1 commit into
Open
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new student study handwriting API layer to the native app so problem-solving/pointing screens can fetch and persist handwriting tied to (publishId, problemId) using the existing OpenAPI + TanStack Query client setup.
Changes:
- Added
useGetStudyHandwritingquery hook for fetching handwriting withstaleTime: Infinityandenabledsupport. - Added
useUpdateStudyHandwritingmutation hook to save/update handwriting and immediately update the query cache. - Regenerated OpenAPI types (
schema.d.ts) and exported the new hooks from the study controller index.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| apps/native/src/types/api/schema.d.ts | Adds Study handwriting endpoint types (and other regenerated schema changes). |
| apps/native/src/apis/controller/student/study/index.ts | Exposes new handwriting hooks from the study controller entrypoint. |
| apps/native/src/apis/controller/student/study/handwriting/useGetStudyHandwriting.ts | New query hook for (publishId, problemId) handwriting retrieval. |
| apps/native/src/apis/controller/student/study/handwriting/putUpdateStudyHandwriting.ts | New mutation hook for saving handwriting + updating cached query data. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
MAT-591 spec 도입. publishId/problemId/type 조합 upsert + 단건 조회.
MAT-591 통합 PR (매니저 generic + ProblemScreen/PointingScreen 통합) 의 base.
- useGetStudyHandwritingSnapshot: GET .../snapshot/{type}, staleTime Infinity
- usePostStudyHandwritingSnapshot: POST .../snapshot, body { type, dataJson }
- onSuccess setQueryData 미장착 - 캐시는 MAT-591 통합 PR 의 wiring 에서 처리
- 옛 useGetStudyHandwriting / useUpdateStudyHandwriting 제거 (consumer 0,
MAT-591 spec 에선 사용 안 함)
- schema.d.ts: pnpm openapi regen (snapshot endpoint 2 개 + StudyHandwritingSnapshotSaveRequest /
StudyHandwritingSnapshotResp + 누적 도메인 schema 동기화)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1355eb3 to
81eb1d7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
MAT-591 신규 spec 인 study handwriting snapshot endpoint 의 hook 두 개 추가. publishId/problemId/type 조합으로 시점별 (
AFTER_FIRST_SUBMIT/AFTER_RETRY_SUBMIT/AFTER_POINTING) 필기 데이터 upsert + 단건 조회. 후속 MAT-591 통합 PR (매니저 generic 화 + ProblemScreen / PointingScreen 통합) 의 base.Linear
Changes
apps/native/src/apis/controller/student/study/handwriting/useGetStudyHandwritingSnapshot.ts신규 — GET/api/student/study/problem/{publishId}/{problemId}/handwriting/snapshot/{type}.StudyHandwritingSnapshotType도 함께 export.staleTime: Infinity,enabled패턴.apps/native/src/apis/controller/student/study/handwriting/usePostStudyHandwritingSnapshot.ts신규 — POST/api/student/study/problem/{publishId}/{problemId}/handwriting/snapshot, body{ type, dataJson }.onSuccess setQueryData미장착 — 캐시는 MAT-591 통합 PR 의 wiring 단일 경로에서 처리.apps/native/src/apis/controller/student/study/index.ts— 옛useGetStudyHandwriting/useUpdateStudyHandwritingexport 제거 (consumer 0). snapshot hook +StudyHandwritingSnapshotTypere-export.apps/native/src/types/api/schema.d.ts—pnpm openapiregen. snapshot endpoint 2 개 +StudyHandwritingSnapshotSaveRequest/StudyHandwritingSnapshotResp추가. 누적된 다른 도메인 schema 변경도 함께 동기화.Testing
pnpm --filter native exec tsc --noEmit— exit 0pnpm --filter native exec eslint <변경 파일>— 0 error (@/apis/clientimport warning 은 주변 hook 과 동일한 사전 존재 패턴)Risk / Impact
Follow-up
useHandwritingManagergeneric 화 —{ scope: 'scrap' | 'study', ... }