mirror of
https://git.v0id.ovh/n3wt-innov/n3wt-school.git
synced 2026-01-29 07:53:23 +00:00
feat: Configuration et gestion du planning [#2]
This commit is contained in:
@ -10,6 +10,7 @@ import { BK_GESTIONENSEIGNANTS_SPECIALITES_URL,
|
||||
BK_GESTIONENSEIGNANTS_PLANNINGS_URL } from '@/utils/Url';
|
||||
import DjangoCSRFToken from '@/components/DjangoCSRFToken'
|
||||
import useCsrfToken from '@/hooks/useCsrfToken';
|
||||
import { ClassesProvider } from '@/context/ClassesContext';
|
||||
|
||||
export default function Page() {
|
||||
const [specialities, setSpecialities] = useState([]);
|
||||
@ -121,8 +122,8 @@ export default function Page() {
|
||||
});
|
||||
};
|
||||
|
||||
const handleUpdatePlanning = (url, id, updatedData) => {
|
||||
fetch(`${url}/${id}`, {
|
||||
const handleUpdatePlanning = (url, planningId, updatedData) => {
|
||||
fetch(`${url}/${planningId}`, {
|
||||
method: 'PUT',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
@ -140,6 +141,7 @@ export default function Page() {
|
||||
console.error('Erreur :', error);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
const handleDelete = (url, id, setDatas) => {
|
||||
fetch(`${url}/${id}`, {
|
||||
@ -184,14 +186,12 @@ export default function Page() {
|
||||
)}
|
||||
|
||||
{activeTab === 'Schedule' && (
|
||||
<ScheduleManagement
|
||||
schedules={schedules}
|
||||
setSchedules={setSchedules}
|
||||
handleUpdatePlanning={handleUpdatePlanning}
|
||||
specialities={specialities}
|
||||
teachers={teachers}
|
||||
classes={classes}
|
||||
/>
|
||||
<ClassesProvider>
|
||||
<ScheduleManagement
|
||||
handleUpdatePlanning={handleUpdatePlanning}
|
||||
classes={classes}
|
||||
/>
|
||||
</ClassesProvider>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user