Working ability to create new Journals
This commit is contained in:
@@ -83,9 +83,9 @@ let lq__journal_obj = $derived(liveQuery(async () => {
|
||||
|
||||
<!-- Add default journal entry -->
|
||||
<span class="flex flex-row items-center gap-1">
|
||||
<span class="text-sm text-gray-500 hidden md:inline">
|
||||
<!-- <span class="text-sm text-gray-500 hidden md:inline">
|
||||
New entry:
|
||||
</span>
|
||||
</span> -->
|
||||
<button
|
||||
class="
|
||||
btn btn-sm
|
||||
|
||||
@@ -208,7 +208,7 @@ if (browser) {
|
||||
}
|
||||
journals_func.create_ae_obj__journal_entry({
|
||||
api_cfg: $ae_api,
|
||||
journal_id: $lq__journal_obj?.journal_id,
|
||||
journal_id: $lq__journal_obj?.journal_id ?? '',
|
||||
data_kv: data_kv,
|
||||
log_lvl: log_lvl
|
||||
}).then((results) => {
|
||||
@@ -216,8 +216,8 @@ if (browser) {
|
||||
$journals_slct.journal_entry_id = results?.journal_entry_id_random;
|
||||
// alert(`Journal entry created successfully! ${$journals_slct.journal_entry_id}`);
|
||||
}).catch((error) => {
|
||||
console.error('Error updating journal entry:', error);
|
||||
alert('Failed to update journal entry.');
|
||||
console.error('Error creating journal entry:', error);
|
||||
alert('Failed to create journal entry.');
|
||||
}).finally(() => {
|
||||
goto(`/journals/${$lq__journal_obj?.journal_id}/entry/${$journals_slct.journal_entry_id}`);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user