Implement V3 PATCH/DELETE wrappers and migrate Journals module to full V3 CRUD.
- Added update_ae_obj_v3, update_nested_obj_v3, delete_ae_obj_v3, and delete_nested_ae_obj_v3. - Refactored Journals and Journal Entries modules to utilize the new V3 API wrappers. - Standardized data processing and IDB caching for all CRUD operations in Journals. - Updated testing page with comprehensive V3 CUD test buttons.
This commit is contained in:
@@ -76,6 +76,48 @@
|
||||
v3_test_result = result;
|
||||
console.log('V3 Create Nested Result:', result);
|
||||
}
|
||||
|
||||
async function test_v3_update_nested() {
|
||||
console.log('*** test_v3_update_nested() ***');
|
||||
v3_test_result = 'loading...';
|
||||
|
||||
// Test updating the journal entry we just created
|
||||
// ID is from the previous step result: nKiyj0JV5CY
|
||||
const result = await api.update_nested_obj_v3({
|
||||
api_cfg: $ae_api,
|
||||
parent_type: 'journal',
|
||||
parent_id: 'JGEB-80-92-50',
|
||||
child_type: 'journal_entry',
|
||||
child_id: 'nKiyj0JV5CY',
|
||||
fields: {
|
||||
name: 'Test V3 Nested Update - UPDATED',
|
||||
content: 'This was UPDATED using the new V3 nested update wrapper!'
|
||||
},
|
||||
log_lvl: 1
|
||||
});
|
||||
|
||||
v3_test_result = result;
|
||||
console.log('V3 Update Nested Result:', result);
|
||||
}
|
||||
|
||||
async function test_v3_delete_nested() {
|
||||
console.log('*** test_v3_delete_nested() ***');
|
||||
v3_test_result = 'loading...';
|
||||
|
||||
// Test soft deleting (disabling) the journal entry we just updated
|
||||
const result = await api.delete_nested_ae_obj_v3({
|
||||
api_cfg: $ae_api,
|
||||
parent_type: 'journal',
|
||||
parent_id: 'JGEB-80-92-50',
|
||||
child_type: 'journal_entry',
|
||||
child_id: 'nKiyj0JV5CY',
|
||||
method: 'disable', // Sets enable = false
|
||||
log_lvl: 1
|
||||
});
|
||||
|
||||
v3_test_result = result;
|
||||
console.log('V3 Delete (Disable) Nested Result:', result);
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="container h-full mx-auto flex flex-col justify-center items-center p-4 gap-4">
|
||||
@@ -92,6 +134,12 @@
|
||||
<button class="btn variant-filled-tertiary" onclick={test_v3_create_nested}>
|
||||
Test V3 Create Nested
|
||||
</button>
|
||||
<button class="btn variant-filled-warning" onclick={test_v3_update_nested}>
|
||||
Test V3 Update Nested
|
||||
</button>
|
||||
<button class="btn variant-filled-error" onclick={test_v3_delete_nested}>
|
||||
Test V3 Delete (Disable) Nested
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user