A lot of code clean up. Also making things look better.

This commit is contained in:
Scott Idem
2024-06-28 17:56:39 -04:00
parent 9f7a19c4b9
commit acaff7634d
10 changed files with 800 additions and 785 deletions

View File

@@ -24,6 +24,7 @@ export let field_type: string = 'text'; // button, text, textarea, template (old
export let field_value: any;
export let allow_null: boolean = false;
export let select_option_li: key_val = {};
export let val_empty_is_null: boolean = false; // This was added to help with a select option list. If the value is empty (''), it will be set to null.
export let edit_label: string = 'Edit';
export let display_inline: boolean = false;
export let display_block_edit: boolean = false;
@@ -78,6 +79,11 @@ async function handle_obj_field_patch(new_field_value: any) {
patch_result = null;
// This was added to help with a select option list. If the value is empty (''), it will be set to null.
if (val_empty_is_null && new_field_value == '') {
new_field_value = null;
}
// NOTE: Is this needed? The field_name, field_value, and fields parameters for update_ae_obj_id_crud() already take care of the data portion. They are added to data_list object as part of the JSON request.
// NOTE: Currently this only handles one field and value at a time. This may need to be changed in the future to use the "fields" parameter as well.
// let patch_data = {}