Skip to content

Commit

Permalink
fix create inst api call
Browse files Browse the repository at this point in the history
  • Loading branch information
CrysR committed Feb 9, 2025
1 parent 2ecdb47 commit d04dd76
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions resources/js/Pages/CreateInst.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ return (
const handleSubmit = (event) => {
event.preventDefault();
let pdp = event.target.elements.PDP.checked;
// We currently only have custom.
let other_schemas = event.target.elements.Custom.checked ? ['Custom'] : null;
// We currently only have custom for potential other schemas. NOte that the shema passed to the API call must match the corresponding backend schema enum value.
let other_schemas = event.target.elements.Custom.checked ? ['CUSTOM'] : null;
var emailDict = {};
var accessDict = {};
Array.from(event.target.elements).forEach((input) => {
Expand Down Expand Up @@ -110,12 +110,12 @@ for (const [key, value] of Object.entries(emailDict)) {
},
})
.then(res => {
document.getElementById('result_area').innerHTML = 'Done. Response: '+ JSON.stringify(res);
document.getElementById('result_area').innerHTML = 'Done. Created new institution with ID: '+ JSON.stringify(res.data.inst_id);
})
.catch(e => {
let err = "";
if( e.response ){
err = e.response.data.error;
err = JSON.stringify(e.response.data.error);
} else {
err = JSON.stringify(e) ;
}
Expand Down

0 comments on commit d04dd76

Please sign in to comment.