Post and post comments now save correctly. The viewed post does not always reflect the update though.

This commit is contained in:
Scott Idem
2024-11-07 14:10:10 -05:00
parent b381cbbc9e
commit d3609764e3
8 changed files with 490 additions and 123 deletions

View File

@@ -429,7 +429,7 @@ async function handle_submit_form(event: any) {
obj_type: 'event',
fields: event_do,
key: $ae_api.api_crud_super_key,
log_lvl: 2
log_lvl: 1
})
.then(function (event_obj_create_result) {
if (!event_obj_create_result) {
@@ -440,19 +440,15 @@ async function handle_submit_form(event: any) {
$idaa_slct.event_id = event_obj_create_result.obj_id_random;
dispatch(
'created__meeting_obj',
{
event_id: $idaa_slct.event_id,
}
);
return event_obj_create_result;
})
.catch(function (error) {
console.log('Something went wrong.');
console.log(error);
return false;
})
.finally(() => {
disable_submit_btn = false;
});
return prom_api__event_obj;
@@ -467,33 +463,22 @@ async function handle_submit_form(event: any) {
.then(function (event_obj_update_result) {
if (!event_obj_update_result) {
console.log('The result was null or false.');
disable_submit_btn = false; // Enable the submit button even if something didn't go right
return false;
}
disable_submit_btn = false;
dispatch(
'updated__meeting_obj',
{
event_id: $idaa_slct.event_id,
}
);
return event_obj_update_result;
})
.catch(function (error) {
console.log('Something went wrong.');
console.log(error);
return false;
})
.finally(() => {
disable_submit_btn = false;
});
return prom_api__event_obj;
}
disable_submit_btn = false;
return true;
}
async function handle_delete_event_obj({event_id, method='disable'}) {