Fixed backend issue, update course status working

This commit is contained in:
Harshitha Shetty
2025-01-04 23:50:59 +05:30
parent b4adca13c7
commit 7079591f84
7 changed files with 123 additions and 454 deletions

View File

@@ -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"
});
};