@@ -103,6 +103,7 @@ const defaultTasks = [
103103
104104const GetPresentEmployeesURL = 'http://localhost:8000/employee/getPresentEmployees'
105105const UpdateEmployeeColumnURL = 'http://localhost:8000/employee/updateEmployeeColumn'
106+ const deleteAttendanceURL = 'http://localhost:8000/attendance/deleteAttendance'
106107
107108const Supervisor = ( ) => {
108109
@@ -124,7 +125,7 @@ const Supervisor = () => {
124125 } )
125126 setTasks ( empDetails )
126127 } )
127- . catch ( e => console . log ( e ) )
128+ // .catch(e => console.log(e))
128129 } , [ ] )
129130
130131
@@ -147,6 +148,7 @@ const Supervisor = () => {
147148 }
148149
149150 function deleteTask ( id ) {
151+ axios . post ( deleteAttendanceURL , { id } )
150152 const newTasks = tasks . filter ( ( task ) => task . id !== id ) ;
151153 setTasks ( newTasks ) ;
152154 }
@@ -189,7 +191,7 @@ const Supervisor = () => {
189191 function onDragStart ( event ) {
190192 if ( event . active . data . current ?. type === "Column" ) {
191193 setActiveColumn ( event . active . data . current . column ) ;
192- console . log ( event . active . data . current . column )
194+ // console.log(event.active.data.current.column)
193195 return ;
194196 }
195197
@@ -214,7 +216,7 @@ const Supervisor = () => {
214216 const isActiveAColumn = active . data . current ?. type === "Column" ;
215217 if ( ! isActiveAColumn ) return ;
216218
217- console . log ( "DRAG END" ) ;
219+ // console.log("DRAG END");
218220
219221 setColumns ( ( columns ) => {
220222 const activeColumnIndex = columns . findIndex ( ( col ) => col . id === activeId ) ;
@@ -261,20 +263,20 @@ const Supervisor = () => {
261263 if ( isActiveATask && isOverAColumn ) {
262264 setTasks ( ( tasks ) => {
263265 const activeIndex = tasks . findIndex ( ( t ) => t . id === activeId ) ;
264- console . log ( tasks [ activeIndex ] )
266+
265267 const { _id } = tasks [ activeIndex ]
266-
268+
267269 const data = {
268270 columnId : overId ,
269271 id : _id
270272 }
271273
272274 axios . post ( UpdateEmployeeColumnURL , data )
273- . then ( ( res ) => console . log ( res . data ) )
274- . catch ( e => console . log ( e ) )
275-
275+ // .then((res) => console.log(res.data))
276+ // .catch(e => console.log(e))
277+
276278 tasks [ activeIndex ] . columnId = overId ;
277- console . log ( "DROPPING TASK OVER COLUMN" , { activeIndex } ) ;
279+ // console.log("DROPPING TASK OVER COLUMN", { activeIndex });
278280 return arrayMove ( tasks , activeIndex , activeIndex ) ;
279281 } ) ;
280282 }
@@ -294,7 +296,7 @@ const Supervisor = () => {
294296 )
295297
296298 return (
297- < div className = 'm-auto flex min-h-screen w-full items-center overflow-x-auto overflow-y-hidden px-[40px]' >
299+ < div className = 'bg-gray-100 m-auto flex min-h-screen w-full items-center overflow-x-auto overflow-y-hidden px-[40px]' >
298300 < DndContext
299301 sensors = { sensors }
300302 onDragStart = { onDragStart }
0 commit comments