Continuing to make updates to the Data Stores to use v3.

This commit is contained in:
Scott Idem
2026-01-29 12:29:14 -05:00
parent 9bf2373a82
commit 2975835d96
12 changed files with 16 additions and 69 deletions

View File

@@ -9,7 +9,7 @@
import { ae_util } from '$lib/ae_utils/ae_utils';
// import { api } from '$lib/api';
// import Element_ae_crud from '$lib/element_ae_crud.svelte';
import Element_data_store from '$lib/elements/element_data_store_v2.svelte';
import Element_data_store from '$lib/elements/element_data_store_v3.svelte';
import { liveQuery } from 'dexie';
// import { core_func } from '$lib/ae_core_functions';
@@ -68,7 +68,7 @@
async function load_activity() {
if (!$slct.person_id) return;
loading_activity = true;
// Load related data using search queries
const [events, posts, logs] = await Promise.all([
qry_ae_obj_li__event({
@@ -114,7 +114,7 @@
async function handle_link_user(user_id_random: string) {
if (!confirm('Link this person to this user account?')) return;
const result = await update_ae_obj__person({
api_cfg: $ae_api,
person_id: $slct.person_id,
@@ -130,7 +130,7 @@
async function handle_unlink_user() {
if (!confirm('Unlink this person from their user account?')) return;
const result = await update_ae_obj__person({
api_cfg: $ae_api,
person_id: $slct.person_id,
@@ -257,8 +257,8 @@
<Unlink size={14} class="mr-2" /> Unlink User
</button>
{:else}
<button
class="btn btn-sm variant-soft-primary"
<button
class="btn btn-sm variant-soft-primary"
onclick={() => { show_link_ui = !show_link_ui; if(show_link_ui) load_unlinked_users(); }}
>
<Link size={14} class="mr-2" /> {show_link_ui ? 'Cancel Linking' : 'Link to User'}
@@ -287,7 +287,7 @@
{:else}
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-2">
{#each available_users as user}
<button
<button
class="card p-3 variant-soft-primary hover:variant-filled-primary text-left transition-all flex flex-col gap-1"
onclick={() => handle_link_user(user.user_id_random)}
>
@@ -405,8 +405,8 @@
</div>
{:else if is_editing}
<div class="px-4">
<Person_form
person={$lq__person_obj}
<Person_form
person={$lq__person_obj}
onSave={(updated) => {
is_editing = false;
// The liveQuery should pick up the changes after they are saved to IndexedDB

View File

@@ -12,9 +12,7 @@
import type { key_val } from '$lib/stores/ae_stores';
import { ae_util } from '$lib/ae_utils/ae_utils';
// import { api } from '$lib/api';
import Element_ae_crud from '$lib/elements/element_ae_crud.svelte';
// import Element_data_store from '$lib/element_data_store_v2.svelte';
import { core_func } from '$lib/ae_core/ae_core_functions';
import {