Skip to content

Commit f9891da

Browse files
committed
Update reportService API endpoint for marking reports as read
- Changed the API endpoint for marking a report as read from `/api/reports/${reportId}` to `/api/reports/${reportId}/status` in both the reportService and its corresponding test file. - This change improves clarity in the API structure.
1 parent 618d4d6 commit f9891da

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

frontend/src/common/api/__tests__/reportService.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ vi.mock('../reportService', async (importOriginal) => {
103103
// Mock markReportAsRead to avoid the dependency on getAuthConfig
104104
markReportAsRead: async (reportId: string) => {
105105
try {
106-
const response = await axios.patch(`/api/reports/${reportId}`, {
106+
const response = await axios.patch(`/api/reports/${reportId}/status`, {
107107
status: 'READ',
108108
});
109109
return response.data;

frontend/src/common/api/reportService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ export const fetchAllReports = async (): Promise<MedicalReport[]> => {
142142
export const markReportAsRead = async (reportId: string): Promise<MedicalReport> => {
143143
try {
144144
const response = await axios.patch(
145-
`${API_URL}/api/reports/${reportId}`,
145+
`${API_URL}/api/reports/${reportId}/status`,
146146
{
147147
status: 'READ',
148148
},

0 commit comments

Comments
 (0)