vision refactor
This commit is contained in:
parent
085b3d72fc
commit
22c944b17c
@ -327,11 +327,11 @@ export default function VisionPage() {
|
||||
|
||||
try {
|
||||
// Fetch user calendars to find the matching calendar
|
||||
const calendarsResponse = await fetch("/api/calendars");
|
||||
if (!calendarsResponse.ok) {
|
||||
const fetchCalendarsResponse = await fetch("/api/calendars");
|
||||
if (!fetchCalendarsResponse.ok) {
|
||||
throw new Error("Impossible de charger les calendriers");
|
||||
}
|
||||
const calendars = await calendarsResponse.json();
|
||||
const calendars = await fetchCalendarsResponse.json();
|
||||
|
||||
// Find the calendar for this mission or group
|
||||
let targetCalendar = null;
|
||||
@ -419,9 +419,9 @@ export default function VisionPage() {
|
||||
await Promise.all(eventPromises);
|
||||
|
||||
// Refresh meetings from database after creation
|
||||
const calendarsResponse = await fetch("/api/calendars");
|
||||
if (calendarsResponse.ok) {
|
||||
const calendarsData = await calendarsResponse.json();
|
||||
const refreshCalendarsResponse = await fetch("/api/calendars");
|
||||
if (refreshCalendarsResponse.ok) {
|
||||
const calendarsData = await refreshCalendarsResponse.json();
|
||||
const meetings = convertCalendarsToMeetings(calendarsData);
|
||||
setScheduledMeetings(meetings);
|
||||
}
|
||||
@ -465,9 +465,9 @@ export default function VisionPage() {
|
||||
}
|
||||
|
||||
// Refresh meetings from database after deletion
|
||||
const calendarsResponse = await fetch("/api/calendars");
|
||||
if (calendarsResponse.ok) {
|
||||
const calendarsData = await calendarsResponse.json();
|
||||
const refreshCalendarsResponse = await fetch("/api/calendars");
|
||||
if (refreshCalendarsResponse.ok) {
|
||||
const calendarsData = await refreshCalendarsResponse.json();
|
||||
const meetings = convertCalendarsToMeetings(calendarsData);
|
||||
setScheduledMeetings(meetings);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user