π Bug Description
When saving a schedule in the Schedule Builder, there is no indication that the schedule has been successfully saved. Additionally, users can save the same schedule multiple times without any restrictions.
β
Steps to Reproduce
- Navigate to the Schedule Builder.
- Create a schedule and save it.
- Observe that there is no feedback confirming the save action.
- Attempt to save the same schedule again.
- Notice that the schedule is saved multiple times without any validation.
π Expected Behavior
- The UI should provide feedback (e.g., a success message or visual indication) when a schedule is saved.
- The system should prevent duplicate schedule saves by checking for existing schedules with the same class numbers.
π₯οΈ System Information
- OS: [Specify OS]
- Browser: [Specify Browser]
- PolyLink Version: [Specify Version]
πΈ Screenshots (If applicable)
Add screenshots if available.
π Acceptance Criteria
π§ Technical Notes
- Modify the frontend logic where we dispatch the action to create or update a calendar:
- [GitHub Permalink](
|
const handleSaveSchedule = () => { |
|
if (currentCalendar) { |
|
dispatch( |
|
calendarActions.createOrUpdateCalendarAsync(currentCalendar.sections) |
|
); |
|
} |
|
}; |
|
|
)
- Update the Redux async thunk that calls the CRUD function for creating/updating calendars:
- [GitHub Permalink](
|
export async function createOrUpdateCalendar( |
|
sections: SelectedSection[] |
|
): Promise<{ |
|
calendars: CalendarListItem[]; |
|
primaryCalendarId: string; |
|
}> { |
|
try { |
|
const response = await fetch(`${serverUrl}/calendars`, { |
|
method: "POST", |
|
body: JSON.stringify({ sections }), |
|
headers: { |
|
"Content-Type": "application/json", |
|
}, |
|
credentials: "include", |
|
}); |
|
const data = await response.json(); |
|
return data; |
|
} catch (error) { |
|
console.error("Error creating or updating calendar:", error); |
|
throw error; |
|
} |
|
} |
)
- Implement backend validation in calendarListServices.ts to check for duplicate schedules before inserting:
- File Path:
server/src/db/models/calendar/calendarListServices.ts
π Related Issues
This should help your team track and resolve the issue efficiently! Let me know if you need adjustments. π
π Bug Description
When saving a schedule in the Schedule Builder, there is no indication that the schedule has been successfully saved. Additionally, users can save the same schedule multiple times without any restrictions.
β Steps to Reproduce
π Expected Behavior
π₯οΈ System Information
πΈ Screenshots (If applicable)
Add screenshots if available.
π Acceptance Criteria
π§ Technical Notes
LAEP-GPT/Client/src/components/calendar/buildSchedule/CalendarBuilderForm.tsx
Lines 89 to 96 in 7a529a3
LAEP-GPT/Client/src/redux/calendar/crudCalendar.ts
Lines 25 to 46 in 7a529a3
server/src/db/models/calendar/calendarListServices.tsπ Related Issues
This should help your team track and resolve the issue efficiently! Let me know if you need adjustments. π