Minor fix if PATCH fails
This commit is contained in:
@@ -641,7 +641,7 @@ $effect(() => {
|
||||
<button
|
||||
type="button"
|
||||
disabled={!tmp_entry_obj_changed}
|
||||
onclick={() => {
|
||||
onclick={async () => {
|
||||
|
||||
let new_content = tmp_entry_obj?.content + '\n\n';
|
||||
|
||||
@@ -667,18 +667,32 @@ $effect(() => {
|
||||
let data_kv = {
|
||||
content: new_content,
|
||||
};
|
||||
journals_func.update_ae_obj__journal_entry({
|
||||
let update_result = await journals_func.update_ae_obj__journal_entry({
|
||||
api_cfg: $ae_api,
|
||||
journal_entry_id: tmp_entry_obj?.journal_entry_id,
|
||||
data_kv: data_kv,
|
||||
log_lvl: log_lvl,
|
||||
}).then(() => {
|
||||
}).then((result) => {
|
||||
// Optionally, you can provide feedback to the user
|
||||
// alert('Journal entry updated successfully!');
|
||||
return result;
|
||||
}).catch((error) => {
|
||||
console.error('Error updating journal entry:', error);
|
||||
alert('Failed to update journal entry.');
|
||||
}).finally(() => {
|
||||
|
||||
|
||||
});
|
||||
if (update_result) {
|
||||
// alert('Journal entry updated successfully!');
|
||||
// Reset the form
|
||||
tmp_entry_obj_append_text_header = '';
|
||||
tmp_entry_obj_append_text = '';
|
||||
tmp_entry_obj_changed = false;
|
||||
$journals_sess.show__modal_append__journal_entry_id = false;
|
||||
} else {
|
||||
alert('Failed to update journal entry.');
|
||||
}
|
||||
}}
|
||||
class:variant-filled-error={tmp_entry_obj_changed}
|
||||
class="
|
||||
|
||||
Reference in New Issue
Block a user