academicYear logic
This commit is contained in:
@@ -78,6 +78,18 @@ export const fetchOptions = async () => {
|
||||
}
|
||||
};
|
||||
|
||||
export const fetchAppointments = async (academicYear) => {
|
||||
try {
|
||||
const response = await fetch(`${BASE_URL}/appointments?academicYear=${academicYear}`);
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to fetch appointments");
|
||||
}
|
||||
return await response.json();
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
return [];
|
||||
}
|
||||
};
|
||||
|
||||
// Save multiple appointments to MongoDB
|
||||
export const saveAppointment = async (appointmentsData) => {
|
||||
|
||||
Reference in New Issue
Block a user