Repository navigation
feat: finish score review flow #26
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| import { apiRequest } from '../shared/api/http'; | ||
|
|
||
| export async function getMonitorClassEvaluations(semesterId) { | ||
| if (!semesterId) return []; | ||
| const response = await apiRequest(`/v1/monitor/evaluations/class-list?semesterId=${semesterId}`); | ||
| return response?.data || response || []; | ||
| } | ||
|
|
||
| export async function getMonitorEvaluationDetail(evaluationId) { | ||
| if (!evaluationId) return null; | ||
| const response = await apiRequest(`/v1/monitor/evaluations/${evaluationId}`); | ||
| return response?.data || response; | ||
| } | ||
|
|
||
| export async function submitMonitorReview(evaluationId, adjustedDetails) { | ||
| const payload = { | ||
| evaluationId, | ||
| adjustedDetails | ||
| }; | ||
| const response = await apiRequest(`/v1/monitor/evaluations/review`, { | ||
| method: 'POST', | ||
| body: JSON.stringify(payload) | ||
| }); | ||
| return response; | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,20 @@ | ||||||||||||||||||||||||||||||||||
| import { apiRequest } from '../shared/api/http'; | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| export async function getEvaluationForm(semesterId) { | ||||||||||||||||||||||||||||||||||
| // Use apiRequest to fetch the form state for the current student | ||||||||||||||||||||||||||||||||||
| const response = await apiRequest(`/api/v1/student/evaluations/form/${semesterId}`); | ||||||||||||||||||||||||||||||||||
| // Often backend wraps data inside { data: ... } | ||||||||||||||||||||||||||||||||||
| return response.data || response; | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| export async function submitEvaluation(semesterId, payload) { | ||||||||||||||||||||||||||||||||||
| // Post payload with { isDraft, detailsJsonb } | ||||||||||||||||||||||||||||||||||
| const response = await apiRequest(`/api/v1/student/evaluations/${semesterId}/submit`, { | ||||||||||||||||||||||||||||||||||
|
Comment on lines
+5
to
+12
|
||||||||||||||||||||||||||||||||||
| const response = await apiRequest(`/api/v1/student/evaluations/form/${semesterId}`); | |
| // Often backend wraps data inside { data: ... } | |
| return response.data || response; | |
| } | |
| export async function submitEvaluation(semesterId, payload) { | |
| // Post payload with { isDraft, detailsJsonb } | |
| const response = await apiRequest(`/api/v1/student/evaluations/${semesterId}/submit`, { | |
| const response = await apiRequest(`/v1/student/evaluations/form/${semesterId}`); | |
| // Often backend wraps data inside { data: ... } | |
| return response.data || response; | |
| } | |
| export async function submitEvaluation(semesterId, payload) { | |
| // Post payload with { isDraft, detailsJsonb } | |
| const response = await apiRequest(`/v1/student/evaluations/${semesterId}/submit`, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file duplicates monitor evaluation endpoints that already exist in
src/api/evaluationApi.js(e.g.getMonitorEvaluationDetail,.../review). Keeping two clients for the same endpoints risks them diverging (different unwrapping, naming, error handling). Consider consolidating on a single API module and re-exporting helpers if needed.