File tree Expand file tree Collapse file tree
app/dashboard/assignments Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -344,7 +344,7 @@ export function AssignmentsClient() {
344344 description : a . description ,
345345 subject : a . subject ,
346346 class : a . class ,
347- deadline : a . deadline ,
347+ deadline : a . deadline . slice ( 0 , 10 ) ,
348348 maxMarks : a . maxMarks ,
349349 } ) ;
350350 setModalOpen ( true ) ;
@@ -387,14 +387,17 @@ export function AssignmentsClient() {
387387 ) ,
388388 ) ;
389389 try {
390- await fetch ( `/api/assignments/${ id } ` , {
390+ const res = await fetch ( `/api/assignments/${ id } ` , {
391391 method : "PUT" ,
392392 headers : { "Content-Type" : "application/json" } ,
393393 body : JSON . stringify ( {
394394 kanbanStatus : col ,
395395 status : col === "submitted" ? "closed" : "active" ,
396396 } ) ,
397397 } ) ;
398+ if ( ! res . ok ) {
399+ throw new Error ( `HTTP ${ res . status } ` ) ;
400+ }
398401 } catch ( error ) {
399402 fetchAssignments ( ) ;
400403 toast (
You can’t perform that action at this time.
0 commit comments