async function editUAChandler(event) {
  console.log("editUACHandler");
  event.preventDefault();

  const a_number = document.querySelector("#a-number").value;
  const uacname = document.querySelector("#uac-edit-name").value;
  const dob = document.querySelector("#uac-dob").value;
  const coo = document.querySelector("#uac-coo").value;
  //   const intake = document.querySelector("#intake").value.trim();
  const gender = document.querySelector("#gender").value;
  const age = document.querySelector("#uac-age").value;
  const category = document.querySelector("#category").value;
  const sir = document.querySelector("#sir").value;
  const sir_narrative = document.querySelector("#sir_narrative").value;
  //   const FRP = document.querySelector("#FRP").value.trim();

  const editUACModal = document.querySelector("#edit-uac-modal");
  const editUACID = UACID.split("/")[2];
  const exception = document.querySelector("#exception").value;

  const response = await fetch("/api/edit/uac/" + editUACID, {
    method: "PUT",
    body: JSON.stringify({
      uacname: uacname,
      a_number: a_number,
      dob: dob,
      coo: coo,
      age: age,
      category: category,
      gender: gender,
      sir: sir,
      sir_narrative: sir_narrative,
      exception: exception,
    }),

    headers: {
      "Content-Type": "application/json",
    },
  });

  if (response.ok) {
    editUACModal.classList.remove("is-active");
    document.location.replace("/dashboard/" + editUACID);
    console.log(response);
  } else {
    alert(response.statusText);
  }
}
//EDIT UAC INFO AND PUT ROUTE//
EDIT UAC INFO AND PUT ROUTE
EDIT UAC INFO AND PUT ROUTE
async function editUAChandler(event) {
  console.log("editUACHandler");
  event.preventDefault();
  const a_number = document.querySelector("#a-number").value;
  const uacname = document.querySelector("#uac-edit-name").value;
  const dob = document.querySelector("#uac-dob").value;
  const coo = document.querySelector("#uac-coo").value;
  const gender = document.querySelector("#gender").value;
  const age = document.querySelector("#uac-age").value;
  const category = document.querySelector("#category").value;
  const sir = document.querySelector("#sir").value;
  const sir_narrative = document.querySelector("#sir_narrative").value;
  const editUACModal = document.querySelector("#edit-uac-modal");
  const editUACID = UACID.split("/")[2];
  const exception = document.querySelector("#exception").value;
  const response = await fetch("/api/edit/uac/" + editUACID, {
    method: "PUT",
    body: JSON.stringify({
      uacname: uacname,
      a_number: a_number,
      dob: dob,
      coo: coo,
      age: age,
      category: category,
      gender: gender,
      sir: sir,
      sir_narrative: sir_narrative,
      exception: exception,
    }),
    headers: {
      "Content-Type": "application/json",
    },
  });
  if (response.ok) {
    editUACModal.classList.remove("is-active");
    document.location.replace("/dashboard/" + editUACID);
    console.log(response);
  } else {
    alert(response.statusText);
  }
}
async function editUAChandler ( event ) { console . log ( "editUACHandler" ) ; event . preventDefault ( ) ; const a_number = document . querySelector ( "#a-number" ) . value ; const uacname = document . querySelector ( "#uac-edit-name" ) . value ; const dob = document . querySelector ( "#uac-dob" ) . value ; const coo = document . querySelector ( "#uac-coo" ) . value ; const gender = document . querySelector ( "#gender" ) . value ; const age = document . querySelector ( "#uac-age" ) . value ; const category = document . querySelector ( "#category" ) . value ; const sir = document . querySelector ( "#sir" ) . value ; const sir_narrative = document . querySelector ( "#sir_narrative" ) . value ; const editUACModal = document . querySelector ( "#edit-uac-modal" ) ; const editUACID = UACID . split ( "/" ) [ 2 ] ; const exception = document . querySelector ( "#exception" ) . value ; const response = await fetch ( "/api/edit/uac/" + editUACID , { method : "PUT" , body : JSON . stringify ( { uacname : uacname , a_number : a_number , dob : dob , coo : coo , age : age , category : category , gender : gender , sir : sir , sir_narrative : sir_narrative , exception : exception , } ) , headers : { "Content-Type" : "application/json" , } , } ) ; if ( response . ok ) { editUACModal . classList . remove ( "is-active" ) ; document . location . replace ( "/dashboard/" + editUACID ) ; console . log ( response ) ; } else { alert ( response . statusText ) ; } }
EDIT UAC INFO AND PUT ROUTE
EDIT UAC INFO AND PUT ROUTE
//   const intake = document.querySelector("#intake").value.trim(); //   const FRP = document.querySelector("#FRP").value.trim();