Updating notes support done!

This commit is contained in:
Yaro Kasear 2025-10-02 15:42:00 -05:00
parent bcf14cf251
commit 53efc8551d
4 changed files with 129 additions and 16 deletions

View file

@ -39,6 +39,8 @@
}
});
console.log(out);
return out;
}
@ -69,13 +71,15 @@
const json = formToJson(e.target);
json.id = {{ field['template_ctx']['values']['id'] }};
// map friendly names to real FK columns if needed
if (json.contact && !json.contact_id) json.contact_id = Number(json.contact) || null;
if (json.work_item && !json.work_item_id) json.work_item_id = Number(json.work_item) || null;
const model_name = {{ field['attrs']['data-model'] | tojson }};
// child mutations
json.updates = collectEditedUpdates();
json.delete_update_ids = collectDeletedIds();
if(model_name === 'inventory') {
json.notes = getMarkdown().trim();
} else if (model_name === 'worklog') {
// child mutations
json.updates = collectEditedUpdates();
json.delete_update_ids = collectDeletedIds();
}
try {
const response = await fetch(