forked from CSI-KJSCE/appointment_to_examiner
Fixed backend issue, update course status working
This commit is contained in:
@@ -120,3 +120,20 @@ export const saveAppointment = async (appointmentsData) => {
|
||||
throw error;
|
||||
}
|
||||
};
|
||||
|
||||
// Update course status
|
||||
export const updateCourseStatus = async (courseId) => {
|
||||
if (!courseId) {
|
||||
throw new Error("Course ID is required to update the status");
|
||||
}
|
||||
|
||||
const url = `${BASE_URL}/courses/${courseId}`;
|
||||
return fetchData(url, {
|
||||
method: "PATCH",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify({ status: "submitted" }), // Update status to "Submitted"
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user