Working on ability to change the presentation name and session name... Making progress. Need to figure out why the file list does not reload correctly right after saving.
This commit is contained in:
@@ -89,7 +89,7 @@ async function handle_obj_field_patch(new_field_value: any) {
|
||||
|
||||
// let params = {};
|
||||
|
||||
ae_promises.api_update__ae_obj = core_func.handle_update_ae_obj_id_crud({
|
||||
ae_promises.api_update__ae_obj = await core_func.handle_update_ae_obj_id_crud({
|
||||
api_cfg: api_cfg,
|
||||
object_type: object_type,
|
||||
object_id: object_id,
|
||||
@@ -100,7 +100,7 @@ async function handle_obj_field_patch(new_field_value: any) {
|
||||
log_lvl: 0
|
||||
})
|
||||
.then(function (results) {
|
||||
console.log('PATCH Promise', results);
|
||||
console.log('Field PATCH Promise', results);
|
||||
|
||||
if (results) {
|
||||
console.log(`Patched - Field Name: ${field_name} with new Field Value: ${new_field_value}; Original Field Value: ${original_field_value}`);
|
||||
@@ -110,7 +110,16 @@ async function handle_obj_field_patch(new_field_value: any) {
|
||||
patch_result = 'PATCH failed';
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log('Something went wrong patching the record.');
|
||||
console.log(error);
|
||||
return false;
|
||||
})
|
||||
.finally(function () {
|
||||
console.log('Field PATCH Promise finally');
|
||||
// This dispatch() must be under "finally".
|
||||
dispatch(
|
||||
'ae_crud_updated',
|
||||
{
|
||||
@@ -121,73 +130,8 @@ async function handle_obj_field_patch(new_field_value: any) {
|
||||
'original_value': original_field_value,
|
||||
}
|
||||
);
|
||||
return true;
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log('Something went wrong patching the record.');
|
||||
console.log(error);
|
||||
return false;
|
||||
})
|
||||
.finally(function () {
|
||||
console.log('PATCH Promise finally');
|
||||
});
|
||||
|
||||
|
||||
// if (ae_promises.api_update__ae_obj) {
|
||||
// console.log(`Patched - Field Name: ${field_name} with new Field Value: ${new_field_value}; Original Field Value: ${original_field_value}`);
|
||||
// patch_result = 'PATCH complete';
|
||||
// } else {
|
||||
// console.log(`Not Patched - Field Name: ${field_name} with new Field Value: ${new_field_value}; Original Field Value: ${original_field_value}`);
|
||||
// patch_result = 'PATCH failed';
|
||||
// return false;
|
||||
// }
|
||||
|
||||
// ae_promises.api_update__ae_obj = api.update_ae_obj_id_crud({
|
||||
// api_cfg: api_cfg,
|
||||
// obj_type: object_type,
|
||||
// obj_id: object_id,
|
||||
// field_name: field_name,
|
||||
// field_value: new_field_value,
|
||||
// // fields: data,
|
||||
// key: api_crud_super_key,
|
||||
// // jwt: null,
|
||||
// // params: params,
|
||||
// // data: patch_data,
|
||||
// log_lvl: 2
|
||||
// })
|
||||
// .then(function (results) {
|
||||
// console.log('PATCH Promise', results);
|
||||
|
||||
// if (results) {
|
||||
// console.log(`Patched - Field Name: ${field_name} with new Field Value: ${new_field_value}; Original Field Value: ${original_field_value}`);
|
||||
// patch_result = 'PATCH complete';
|
||||
// } else {
|
||||
// console.log(`Not Patched - Field Name: ${field_name} with new Field Value: ${new_field_value}; Original Field Value: ${original_field_value}`);
|
||||
// patch_result = 'PATCH failed';
|
||||
// return false;
|
||||
// }
|
||||
|
||||
// dispatch(
|
||||
// 'ae_crud_updated',
|
||||
// {
|
||||
// 'type': object_type,
|
||||
// 'id': object_id,
|
||||
// 'field_name': field_name,
|
||||
// 'field_value': new_field_value,
|
||||
// 'original_value': original_field_value,
|
||||
// }
|
||||
// );
|
||||
// return true;
|
||||
// })
|
||||
// .catch(function (error) {
|
||||
// console.log('Something went wrong patching the record.');
|
||||
// console.log(error);
|
||||
// return false;
|
||||
// })
|
||||
// .finally(function () {
|
||||
// console.log('PATCH Promise finally');
|
||||
// });
|
||||
|
||||
return ae_promises.api_update__ae_obj;
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user