More code clean up
This commit is contained in:
@@ -15,7 +15,7 @@ interface CreateAeObjV3Params {
|
||||
log_lvl?: number;
|
||||
}
|
||||
|
||||
export async function create_ae_obj_v3({
|
||||
export async function create_ae_obj({
|
||||
api_cfg,
|
||||
obj_type,
|
||||
fields,
|
||||
@@ -25,7 +25,7 @@ export async function create_ae_obj_v3({
|
||||
const endpoint = `/v3/crud/${obj_type}/`;
|
||||
|
||||
if (log_lvl) {
|
||||
console.log('*** create_ae_obj_v3 ***');
|
||||
console.log('*** create_ae_obj ***');
|
||||
console.log('Endpoint:', endpoint);
|
||||
console.log('Fields:', fields);
|
||||
}
|
||||
@@ -67,7 +67,7 @@ interface CreateNestedObjV3Params {
|
||||
log_lvl?: number;
|
||||
}
|
||||
|
||||
export async function create_nested_obj_v3({
|
||||
export async function create_nested_obj({
|
||||
api_cfg,
|
||||
parent_type,
|
||||
parent_id,
|
||||
@@ -86,7 +86,7 @@ export async function create_nested_obj_v3({
|
||||
const endpoint = `/v3/crud/${p_type}/${p_id}/${c_type}/`;
|
||||
|
||||
if (log_lvl) {
|
||||
console.log('*** create_nested_obj_v3 ***');
|
||||
console.log('*** create_nested_obj ***');
|
||||
console.log('Endpoint:', endpoint);
|
||||
console.log('Fields:', fields);
|
||||
}
|
||||
@@ -121,7 +121,7 @@ interface UpdateAeObjV3Params {
|
||||
log_lvl?: number;
|
||||
}
|
||||
|
||||
export async function update_ae_obj_v3({
|
||||
export async function update_ae_obj({
|
||||
api_cfg,
|
||||
obj_type,
|
||||
obj_id,
|
||||
@@ -132,7 +132,7 @@ export async function update_ae_obj_v3({
|
||||
const endpoint = `/v3/crud/${obj_type}/${obj_id}`;
|
||||
|
||||
if (log_lvl) {
|
||||
console.log('*** update_ae_obj_v3 ***');
|
||||
console.log('*** update_ae_obj ***');
|
||||
console.log('Endpoint:', endpoint);
|
||||
console.log('Fields:', fields);
|
||||
}
|
||||
@@ -172,7 +172,7 @@ interface UpdateNestedObjV3Params {
|
||||
log_lvl?: number;
|
||||
}
|
||||
|
||||
export async function update_nested_obj_v3({
|
||||
export async function update_nested_obj({
|
||||
api_cfg,
|
||||
parent_type,
|
||||
parent_id,
|
||||
@@ -194,7 +194,7 @@ export async function update_nested_obj_v3({
|
||||
const endpoint = `/v3/crud/${p_type}/${p_id}/${c_type}/${c_id}`;
|
||||
|
||||
if (log_lvl) {
|
||||
console.log('*** update_nested_obj_v3 ***');
|
||||
console.log('*** update_nested_obj ***');
|
||||
console.log('Endpoint:', endpoint);
|
||||
console.log('Fields:', fields);
|
||||
}
|
||||
|
||||
@@ -223,7 +223,7 @@ export async function create_ae_obj__archive({
|
||||
console.log(`*** create_ae_obj__archive() *** account_id=${account_id}`);
|
||||
}
|
||||
|
||||
const result = await api.create_ae_obj_v3({
|
||||
const result = await api.create_ae_obj({
|
||||
api_cfg,
|
||||
obj_type: 'archive',
|
||||
fields: {
|
||||
@@ -307,7 +307,7 @@ export async function update_ae_obj__archive({
|
||||
console.log(`*** update_ae_obj__archive() *** archive_id=${archive_id}`, data_kv);
|
||||
}
|
||||
|
||||
const result = await api.update_ae_obj_v3({
|
||||
const result = await api.update_ae_obj({
|
||||
api_cfg,
|
||||
obj_type: 'archive',
|
||||
obj_id: archive_id,
|
||||
|
||||
@@ -170,7 +170,7 @@ export async function create_ae_obj__archive_content({
|
||||
return null;
|
||||
}
|
||||
|
||||
const result = await api.create_nested_obj_v3({
|
||||
const result = await api.create_nested_obj({
|
||||
api_cfg,
|
||||
parent_type: 'archive',
|
||||
parent_id: archive_id,
|
||||
@@ -258,7 +258,7 @@ export async function update_ae_obj__archive_content({
|
||||
);
|
||||
}
|
||||
|
||||
const result = await api.update_ae_obj_v3({
|
||||
const result = await api.update_ae_obj({
|
||||
api_cfg,
|
||||
obj_type: 'archive_content',
|
||||
obj_id: archive_content_id,
|
||||
|
||||
@@ -154,7 +154,7 @@ export async function create_ae_obj__account({
|
||||
}
|
||||
|
||||
ae_promises.create__account = await api
|
||||
.create_ae_obj_v3({
|
||||
.create_ae_obj({
|
||||
api_cfg: api_cfg,
|
||||
obj_type: 'account',
|
||||
fields: data_kv,
|
||||
@@ -209,7 +209,7 @@ export async function update_ae_obj__account({
|
||||
console.log(`*** update_ae_obj__account() *** account_id=${account_id}`, data_kv);
|
||||
}
|
||||
|
||||
const result = await api.update_ae_obj_v3({
|
||||
const result = await api.update_ae_obj({
|
||||
api_cfg,
|
||||
obj_type: 'account',
|
||||
obj_id: account_id,
|
||||
|
||||
@@ -104,7 +104,7 @@ export async function create_ae_obj__activity_log({
|
||||
return null;
|
||||
}
|
||||
|
||||
ae_promises.create__activity_log = await api.create_ae_obj_v3({
|
||||
ae_promises.create__activity_log = await api.create_ae_obj({
|
||||
api_cfg,
|
||||
obj_type: 'activity_log',
|
||||
fields: {
|
||||
@@ -136,7 +136,7 @@ export async function update_ae_obj__activity_log({
|
||||
console.log(`*** update_ae_obj__activity_log() *** activity_log_id=${activity_log_id}`);
|
||||
}
|
||||
|
||||
ae_promises.update__activity_log_obj = await api.update_ae_obj_v3({
|
||||
ae_promises.update__activity_log_obj = await api.update_ae_obj({
|
||||
api_cfg,
|
||||
obj_type: 'activity_log',
|
||||
obj_id: activity_log_id,
|
||||
|
||||
@@ -124,7 +124,7 @@ export async function create_ae_obj__address({
|
||||
try_cache?: boolean;
|
||||
log_lvl?: number;
|
||||
}): Promise<ae_Address | null> {
|
||||
const result = await api.create_ae_obj_v3({
|
||||
const result = await api.create_ae_obj({
|
||||
api_cfg,
|
||||
obj_type: 'address',
|
||||
fields: {
|
||||
@@ -164,7 +164,7 @@ export async function update_ae_obj__address({
|
||||
try_cache?: boolean;
|
||||
log_lvl?: number;
|
||||
}): Promise<ae_Address | null> {
|
||||
const result = await api.update_ae_obj_v3({
|
||||
const result = await api.update_ae_obj({
|
||||
api_cfg,
|
||||
obj_type: 'address',
|
||||
obj_id: address_id,
|
||||
|
||||
@@ -122,7 +122,7 @@ export async function create_ae_obj__contact({
|
||||
try_cache?: boolean;
|
||||
log_lvl?: number;
|
||||
}): Promise<ae_Contact | null> {
|
||||
const result = await api.create_ae_obj_v3({
|
||||
const result = await api.create_ae_obj({
|
||||
api_cfg,
|
||||
obj_type: 'contact',
|
||||
fields: {
|
||||
@@ -162,7 +162,7 @@ export async function update_ae_obj__contact({
|
||||
try_cache?: boolean;
|
||||
log_lvl?: number;
|
||||
}): Promise<ae_Contact | null> {
|
||||
const result = await api.update_ae_obj_v3({
|
||||
const result = await api.update_ae_obj({
|
||||
api_cfg,
|
||||
obj_type: 'contact',
|
||||
obj_id: contact_id,
|
||||
|
||||
@@ -207,7 +207,7 @@ export async function create_ae_obj__person({
|
||||
if (account_id) fields.account_id_random = account_id;
|
||||
if (user_id) fields.user_id_random = user_id;
|
||||
|
||||
const result = await api.create_ae_obj_v3({
|
||||
const result = await api.create_ae_obj({
|
||||
api_cfg,
|
||||
obj_type: 'person',
|
||||
fields,
|
||||
@@ -248,7 +248,7 @@ export async function update_ae_obj__person({
|
||||
try_cache?: boolean;
|
||||
log_lvl?: number;
|
||||
}): Promise<ae_Person | null> {
|
||||
const result = await api.update_ae_obj_v3({
|
||||
const result = await api.update_ae_obj({
|
||||
api_cfg,
|
||||
obj_type: 'person',
|
||||
obj_id: person_id,
|
||||
|
||||
@@ -331,7 +331,7 @@ export async function create_ae_obj__site({
|
||||
try_cache?: boolean;
|
||||
log_lvl?: number;
|
||||
}): Promise<ae_Site | null> {
|
||||
const result = await api.create_ae_obj_v3({
|
||||
const result = await api.create_ae_obj({
|
||||
api_cfg,
|
||||
obj_type: 'site',
|
||||
fields: {
|
||||
@@ -375,7 +375,7 @@ export async function update_ae_obj__site({
|
||||
try_cache?: boolean;
|
||||
log_lvl?: number;
|
||||
}): Promise<ae_Site | null> {
|
||||
const result = await api.update_ae_obj_v3({
|
||||
const result = await api.update_ae_obj({
|
||||
api_cfg,
|
||||
obj_type: 'site',
|
||||
obj_id: site_id,
|
||||
@@ -518,7 +518,7 @@ export async function create_ae_obj__site_domain({
|
||||
try_cache?: boolean;
|
||||
log_lvl?: number;
|
||||
}): Promise<ae_SiteDomain | null> {
|
||||
const result = await api.create_nested_obj_v3({
|
||||
const result = await api.create_nested_obj({
|
||||
api_cfg,
|
||||
parent_type: 'site',
|
||||
parent_id: site_id,
|
||||
@@ -564,7 +564,7 @@ export async function update_ae_obj__site_domain({
|
||||
try_cache?: boolean;
|
||||
log_lvl?: number;
|
||||
}): Promise<ae_SiteDomain | null> {
|
||||
const result = await api.update_nested_obj_v3({
|
||||
const result = await api.update_nested_obj({
|
||||
api_cfg,
|
||||
parent_type: 'site',
|
||||
parent_id: site_id,
|
||||
|
||||
@@ -197,7 +197,7 @@ export async function create_ae_obj__user({
|
||||
const fields: key_val = { ...data_kv };
|
||||
if (account_id) fields.account_id_random = account_id;
|
||||
|
||||
const result = await api.create_ae_obj_v3({
|
||||
const result = await api.create_ae_obj({
|
||||
api_cfg,
|
||||
obj_type: 'user',
|
||||
fields,
|
||||
@@ -238,7 +238,7 @@ export async function update_ae_obj__user({
|
||||
try_cache?: boolean;
|
||||
log_lvl?: number;
|
||||
}): Promise<ae_User | null> {
|
||||
const result = await api.update_ae_obj_v3({
|
||||
const result = await api.update_ae_obj({
|
||||
api_cfg,
|
||||
obj_type: 'user',
|
||||
obj_id: user_id,
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* Manages: priority, hide, enable, alert, delete/disable
|
||||
*
|
||||
* Emits events — NO API calls. Parent is responsible for:
|
||||
* 1. Calling the API (update_ae_obj_v3, delete_ae_obj_id__*)
|
||||
* 1. Calling the API (update_ae_obj, delete_ae_obj_id__*)
|
||||
* 2. Refreshing the object from cache/API
|
||||
* 3. Navigating away on delete
|
||||
*
|
||||
|
||||
@@ -374,7 +374,7 @@ export async function create_ae_obj__event({
|
||||
try_cache?: boolean;
|
||||
log_lvl?: number;
|
||||
}): Promise<ae_Event | null> {
|
||||
const result = await api.create_ae_obj_v3({
|
||||
const result = await api.create_ae_obj({
|
||||
api_cfg,
|
||||
obj_type: 'event',
|
||||
fields: {
|
||||
@@ -455,7 +455,7 @@ export async function update_ae_obj__event({
|
||||
try_cache?: boolean;
|
||||
log_lvl?: number;
|
||||
}): Promise<ae_Event | null> {
|
||||
const result = await api.update_ae_obj_v3({
|
||||
const result = await api.update_ae_obj({
|
||||
api_cfg,
|
||||
obj_type: 'event',
|
||||
obj_id: event_id,
|
||||
|
||||
@@ -3,8 +3,8 @@ import { describe, it, expect, vi } from 'vitest';
|
||||
// Use hoist-safe factories for vi.mock
|
||||
vi.mock('$lib/api/api', () => ({
|
||||
api: {
|
||||
create_nested_obj_v3: vi.fn(),
|
||||
update_nested_obj_v3: vi.fn(),
|
||||
create_nested_obj: vi.fn(),
|
||||
update_nested_obj: vi.fn(),
|
||||
delete_nested_ae_obj: vi.fn(),
|
||||
search_ae_obj: vi.fn()
|
||||
}
|
||||
@@ -16,9 +16,9 @@ vi.mock('$lib/ae_events/ae_events__event_badge_template', () => ({ load_ae_obj_i
|
||||
import { create_ae_obj__event_badge } from './ae_events__event_badge';
|
||||
|
||||
describe('create_ae_obj__event_badge', () => {
|
||||
it('calls api.create_nested_obj_v3 with the correct params and returns the result', async () => {
|
||||
it('calls api.create_nested_obj with the correct params and returns the result', async () => {
|
||||
const mocked = await import('$lib/api/api');
|
||||
const mockCreateNested = mocked.api.create_nested_obj_v3 as any;
|
||||
const mockCreateNested = mocked.api.create_nested_obj as any;
|
||||
|
||||
const fakeResult = { event_badge_id: 'eb123', full_name: 'Test User' };
|
||||
mockCreateNested.mockResolvedValue(fakeResult);
|
||||
@@ -45,9 +45,9 @@ describe('create_ae_obj__event_badge', () => {
|
||||
});
|
||||
|
||||
describe('update_ae_obj__event_badge', () => {
|
||||
it('calls api.update_nested_obj_v3 with correct params and returns result', async () => {
|
||||
it('calls api.update_nested_obj with correct params and returns result', async () => {
|
||||
const mocked = await import('$lib/api/api');
|
||||
const mockUpdate = mocked.api.update_nested_obj_v3 as any;
|
||||
const mockUpdate = mocked.api.update_nested_obj as any;
|
||||
const fakeResult = { event_badge_id: 'eb999', full_name: 'Updated' };
|
||||
mockUpdate.mockResolvedValue(fakeResult);
|
||||
|
||||
|
||||
@@ -226,7 +226,7 @@ export async function create_ae_obj__event_badge({
|
||||
console.log(`*** create_ae_obj__event_badge() *** event_id=${event_id}`);
|
||||
}
|
||||
|
||||
const result = await api.create_nested_obj_v3({
|
||||
const result = await api.create_nested_obj({
|
||||
api_cfg,
|
||||
parent_type: 'event',
|
||||
parent_id: event_id,
|
||||
@@ -318,7 +318,7 @@ export async function update_ae_obj__event_badge({
|
||||
console.log(`*** update_ae_obj__event_badge() *** event_badge_id=${event_badge_id}`);
|
||||
}
|
||||
|
||||
const result = await api.update_nested_obj_v3({
|
||||
const result = await api.update_nested_obj({
|
||||
api_cfg,
|
||||
parent_type: 'event',
|
||||
parent_id: event_id,
|
||||
|
||||
@@ -255,7 +255,7 @@ export async function create_ae_obj__event_badge_template({
|
||||
try_cache?: boolean;
|
||||
log_lvl?: number;
|
||||
}) {
|
||||
const result = await api.create_nested_obj_v3({
|
||||
const result = await api.create_nested_obj({
|
||||
api_cfg,
|
||||
for_obj_type: 'event',
|
||||
for_obj_id: event_id,
|
||||
@@ -328,7 +328,7 @@ export async function update_ae_obj__event_badge_template({
|
||||
try_cache?: boolean;
|
||||
log_lvl?: number;
|
||||
}) {
|
||||
const result = await api.update_nested_obj_v3({
|
||||
const result = await api.update_nested_obj({
|
||||
api_cfg,
|
||||
for_obj_type: 'event',
|
||||
for_obj_id: event_id,
|
||||
|
||||
@@ -201,7 +201,7 @@ export async function create_ae_obj__event_device({
|
||||
console.log(`*** create_ae_obj__event_device() *** [V3] event_id=${event_id}`);
|
||||
}
|
||||
|
||||
const result = await api.create_nested_obj_v3({
|
||||
const result = await api.create_nested_obj({
|
||||
api_cfg,
|
||||
for_obj_type: 'event',
|
||||
for_obj_id: event_id,
|
||||
@@ -299,7 +299,7 @@ export async function update_ae_obj__event_device({
|
||||
console.log(`*** update_ae_obj__event_device() *** [V3] id=${event_device_id}`);
|
||||
}
|
||||
|
||||
const result = await api.update_nested_obj_v3({
|
||||
const result = await api.update_nested_obj({
|
||||
api_cfg,
|
||||
for_obj_type: 'event',
|
||||
for_obj_id: event_id,
|
||||
|
||||
@@ -344,7 +344,7 @@ export async function update_ae_obj__event_file({
|
||||
try_cache?: boolean;
|
||||
log_lvl?: number;
|
||||
}): Promise<ae_EventFile | null> {
|
||||
const result = await api.update_ae_obj_v3({
|
||||
const result = await api.update_ae_obj({
|
||||
api_cfg,
|
||||
obj_type: 'event_file',
|
||||
obj_id: event_file_id,
|
||||
|
||||
@@ -241,7 +241,7 @@ export async function create_ae_obj__event_location({
|
||||
try_cache?: boolean;
|
||||
log_lvl?: number;
|
||||
}): Promise<ae_EventLocation | null> {
|
||||
const result = await api.create_nested_obj_v3({
|
||||
const result = await api.create_nested_obj({
|
||||
api_cfg,
|
||||
for_obj_type: 'event',
|
||||
for_obj_id: event_id,
|
||||
@@ -312,7 +312,7 @@ export async function update_ae_obj__event_location({
|
||||
try_cache?: boolean;
|
||||
log_lvl?: number;
|
||||
}): Promise<ae_EventLocation | null> {
|
||||
const result = await api.update_nested_obj_v3({
|
||||
const result = await api.update_nested_obj({
|
||||
api_cfg,
|
||||
for_obj_type: 'event',
|
||||
for_obj_id: event_id,
|
||||
|
||||
@@ -218,7 +218,7 @@ export async function create_ae_obj__event_presentation({
|
||||
try_cache?: boolean;
|
||||
log_lvl?: number;
|
||||
}): Promise<ae_EventPresentation | null> {
|
||||
const result = await api.create_nested_obj_v3({
|
||||
const result = await api.create_nested_obj({
|
||||
api_cfg,
|
||||
for_obj_type: 'event_session',
|
||||
for_obj_id: event_session_id,
|
||||
@@ -279,7 +279,7 @@ export async function update_ae_obj__event_presentation({
|
||||
try_cache?: boolean;
|
||||
log_lvl?: number;
|
||||
}): Promise<ae_EventPresentation | null> {
|
||||
const result = await api.update_ae_obj_v3({
|
||||
const result = await api.update_ae_obj({
|
||||
api_cfg, obj_type: 'event_presentation', obj_id: event_presentation_id, fields: data_kv, log_lvl
|
||||
});
|
||||
if (result) {
|
||||
|
||||
@@ -197,7 +197,7 @@ export async function create_ae_obj__event_presenter({
|
||||
console.error('create_ae_obj__event_presenter: event_presentation_id is required');
|
||||
return null;
|
||||
}
|
||||
const result = await api.create_nested_obj_v3({
|
||||
const result = await api.create_nested_obj({
|
||||
api_cfg,
|
||||
for_obj_type: 'event_presentation',
|
||||
for_obj_id: event_presentation_id,
|
||||
@@ -278,7 +278,7 @@ export async function update_ae_obj__event_presenter({
|
||||
console.error('update_ae_obj__event_presenter: event_presentation_id is required');
|
||||
return null;
|
||||
}
|
||||
const result = await api.update_nested_obj_v3({
|
||||
const result = await api.update_nested_obj({
|
||||
api_cfg,
|
||||
for_obj_type: 'event_presentation',
|
||||
for_obj_id: event_presentation_id,
|
||||
|
||||
@@ -282,7 +282,7 @@ export async function create_ae_obj__event_session({
|
||||
console.error('create_ae_obj__event_session: event_id is required');
|
||||
return null;
|
||||
}
|
||||
const result = await api.create_nested_obj_v3({
|
||||
const result = await api.create_nested_obj({
|
||||
api_cfg,
|
||||
for_obj_type: 'event',
|
||||
for_obj_id: event_id,
|
||||
@@ -360,7 +360,7 @@ export async function update_ae_obj__event_session({
|
||||
console.error('update_ae_obj__event_session: event_id is required');
|
||||
return null;
|
||||
}
|
||||
const result = await api.update_nested_obj_v3({
|
||||
const result = await api.update_nested_obj({
|
||||
api_cfg,
|
||||
for_obj_type: 'event',
|
||||
for_obj_id: event_id,
|
||||
|
||||
@@ -307,7 +307,7 @@ export async function create_ae_obj__exhibit({
|
||||
try_cache?: boolean;
|
||||
log_lvl?: number;
|
||||
}): Promise<ae_EventExhibit | null> {
|
||||
const result = await api.create_nested_obj_v3({
|
||||
const result = await api.create_nested_obj({
|
||||
api_cfg,
|
||||
parent_type: 'event',
|
||||
parent_id: event_id,
|
||||
@@ -351,7 +351,7 @@ export async function update_ae_obj__exhibit({
|
||||
try_cache?: boolean;
|
||||
log_lvl?: number;
|
||||
}): Promise<ae_EventExhibit | null> {
|
||||
const result = await api.update_nested_obj_v3({
|
||||
const result = await api.update_nested_obj({
|
||||
api_cfg,
|
||||
parent_type: 'event',
|
||||
parent_id: event_id,
|
||||
|
||||
@@ -324,7 +324,7 @@ export async function create_ae_obj__exhibit_tracking({
|
||||
try_cache?: boolean;
|
||||
log_lvl?: number;
|
||||
}): Promise<ae_EventExhibitTracking | null> {
|
||||
const result = await api.create_nested_obj_v3({
|
||||
const result = await api.create_nested_obj({
|
||||
api_cfg,
|
||||
parent_type: 'event_exhibit',
|
||||
parent_id: exhibit_id,
|
||||
@@ -372,7 +372,7 @@ export async function update_ae_obj__exhibit_tracking({
|
||||
try_cache?: boolean;
|
||||
log_lvl?: number;
|
||||
}): Promise<ae_EventExhibitTracking | null> {
|
||||
const result = await api.update_nested_obj_v3({
|
||||
const result = await api.update_nested_obj({
|
||||
api_cfg,
|
||||
parent_type: 'event_exhibit',
|
||||
parent_id: exhibit_id,
|
||||
|
||||
@@ -396,7 +396,7 @@ export async function create_ae_obj__journal({
|
||||
}
|
||||
|
||||
ae_promises.create__journal = await api
|
||||
.create_ae_obj_v3({
|
||||
.create_ae_obj({
|
||||
api_cfg: api_cfg,
|
||||
obj_type: 'journal',
|
||||
fields: {
|
||||
@@ -511,7 +511,7 @@ export async function update_ae_obj__journal({
|
||||
}
|
||||
|
||||
// Perform the API update
|
||||
const result = await api.update_ae_obj_v3({
|
||||
const result = await api.update_ae_obj({
|
||||
api_cfg: api_cfg,
|
||||
obj_type: 'journal',
|
||||
obj_id: journal_id,
|
||||
|
||||
@@ -215,7 +215,7 @@ export async function create_ae_obj__journal_entry({
|
||||
}
|
||||
|
||||
ae_promises.create__journal_entry = await api
|
||||
.create_nested_obj_v3({
|
||||
.create_nested_obj({
|
||||
api_cfg: api_cfg,
|
||||
parent_type: 'journal',
|
||||
parent_id: journal_id,
|
||||
@@ -568,7 +568,7 @@ export async function update_ae_obj__journal_entry({
|
||||
}
|
||||
|
||||
// Perform the API update
|
||||
const result = await api.update_ae_obj_v3({
|
||||
const result = await api.update_ae_obj({
|
||||
api_cfg: api_cfg,
|
||||
obj_type: 'journal_entry',
|
||||
obj_id: journal_entry_id,
|
||||
|
||||
@@ -209,7 +209,7 @@ export async function create_ae_obj__post({
|
||||
console.log(`*** create_ae_obj__post() *** account_id=${account_id}`);
|
||||
}
|
||||
|
||||
const result = await api.create_ae_obj_v3({
|
||||
const result = await api.create_ae_obj({
|
||||
api_cfg,
|
||||
obj_type: 'post',
|
||||
fields: {
|
||||
@@ -294,7 +294,7 @@ export async function update_ae_obj__post({
|
||||
console.log(`*** update_ae_obj__post() *** post_id=${post_id}`, data_kv);
|
||||
}
|
||||
|
||||
const result = await api.update_ae_obj_v3({
|
||||
const result = await api.update_ae_obj({
|
||||
api_cfg,
|
||||
obj_type: 'post',
|
||||
obj_id: post_id,
|
||||
|
||||
@@ -164,7 +164,7 @@ export async function create_ae_obj__post_comment({
|
||||
console.log(`*** create_ae_obj__post_comment() *** account_id=${account_id} post_id=${post_id}`);
|
||||
}
|
||||
|
||||
const result = await api.create_nested_obj_v3({
|
||||
const result = await api.create_nested_obj({
|
||||
api_cfg,
|
||||
parent_type: 'post',
|
||||
parent_id: post_id,
|
||||
@@ -251,7 +251,7 @@ export async function update_ae_obj__post_comment({
|
||||
console.log(`*** update_ae_obj__post_comment() *** post_comment_id=${post_comment_id}`, data_kv);
|
||||
}
|
||||
|
||||
const result = await api.update_ae_obj_v3({
|
||||
const result = await api.update_ae_obj({
|
||||
api_cfg,
|
||||
obj_type: 'post_comment',
|
||||
obj_id: post_comment_id,
|
||||
|
||||
@@ -377,7 +377,7 @@ export async function create_ae_obj__sponsorship({
|
||||
data: any;
|
||||
log_lvl?: number;
|
||||
}) {
|
||||
return await api.create_ae_obj_v3({
|
||||
return await api.create_ae_obj({
|
||||
api_cfg,
|
||||
obj_type: 'sponsorship',
|
||||
fields: data,
|
||||
@@ -399,7 +399,7 @@ export async function update_ae_obj__sponsorship({
|
||||
data: any;
|
||||
log_lvl?: number;
|
||||
}) {
|
||||
return await api.update_ae_obj_v3({
|
||||
return await api.update_ae_obj({
|
||||
api_cfg,
|
||||
obj_type: 'sponsorship',
|
||||
obj_id: sponsorship_id,
|
||||
|
||||
@@ -19,11 +19,11 @@ import {
|
||||
} from '$lib/ae_api/api_get__crud_obj_li';
|
||||
import { search_ae_obj } from '$lib/ae_api/api_post__crud_search';
|
||||
import {
|
||||
create_ae_obj_v3,
|
||||
create_nested_obj_v3,
|
||||
update_ae_obj_v3,
|
||||
update_nested_obj_v3,
|
||||
delete_ae_obj,
|
||||
create_ae_obj,
|
||||
create_nested_obj,
|
||||
update_ae_obj,
|
||||
update_nested_obj,
|
||||
delete_ae_obj,
|
||||
delete_nested_ae_obj
|
||||
} from '$lib/ae_api/api_post__crud_obj';
|
||||
|
||||
@@ -659,10 +659,10 @@ const obj = {
|
||||
get_ae_obj_li: get_ae_obj_li,
|
||||
get_nested_obj_li: get_nested_obj_li,
|
||||
search_ae_obj: search_ae_obj,
|
||||
create_ae_obj_v3: create_ae_obj_v3,
|
||||
create_nested_obj_v3: create_nested_obj_v3,
|
||||
update_ae_obj_v3: update_ae_obj_v3,
|
||||
update_nested_obj_v3: update_nested_obj_v3,
|
||||
create_ae_obj: create_ae_obj,
|
||||
create_nested_obj: create_nested_obj,
|
||||
update_ae_obj: update_ae_obj,
|
||||
update_nested_obj: update_nested_obj,
|
||||
delete_ae_obj:delete_ae_obj,
|
||||
delete_nested_ae_obj: delete_nested_ae_obj,
|
||||
create_ae_obj_crud: create_ae_obj_crud,
|
||||
|
||||
@@ -103,7 +103,7 @@
|
||||
error_message = '';
|
||||
|
||||
try {
|
||||
const result = await api.update_ae_obj_v3({
|
||||
const result = await api.update_ae_obj({
|
||||
api_cfg: $ae_api,
|
||||
obj_type: object_type,
|
||||
obj_id: object_id,
|
||||
|
||||
@@ -258,7 +258,7 @@
|
||||
const api_cfg = untrack(() => $ae_api);
|
||||
|
||||
if ($lq__ds_obj?.id) {
|
||||
ds_submit_results = api.update_ae_obj_v3({
|
||||
ds_submit_results = api.update_ae_obj({
|
||||
api_cfg,
|
||||
obj_type: 'data_store',
|
||||
obj_id: $lq__ds_obj.id,
|
||||
@@ -271,7 +271,7 @@
|
||||
return res;
|
||||
});
|
||||
} else {
|
||||
ds_submit_results = api.create_ae_obj_v3({
|
||||
ds_submit_results = api.create_ae_obj({
|
||||
api_cfg,
|
||||
obj_type: 'data_store',
|
||||
fields: data_store_do
|
||||
|
||||
Reference in New Issue
Block a user