Lots of work on the Journals
This commit is contained in:
@@ -2,6 +2,7 @@ import type { key_val } from '$lib/ae_stores';
|
||||
import { api } from '$lib/api';
|
||||
|
||||
import { db_journals } from "$lib/ae_journals/db_journals";
|
||||
import { marked } from 'marked';
|
||||
|
||||
let ae_promises: key_val = {};
|
||||
|
||||
@@ -357,6 +358,7 @@ export async function db_save_ae_obj_li__journal_entry(
|
||||
category_code: obj.category_code,
|
||||
type_code: obj.type_code,
|
||||
topic_code: obj.topic_code,
|
||||
tags: obj.tags,
|
||||
|
||||
public: obj.public,
|
||||
private: obj.private,
|
||||
@@ -369,6 +371,7 @@ export async function db_save_ae_obj_li__journal_entry(
|
||||
// description: obj.description,
|
||||
|
||||
content: obj.content,
|
||||
content_md_html: marked.parse(obj.content),
|
||||
content_html: obj.content_html,
|
||||
content_json: obj.content_json,
|
||||
|
||||
@@ -415,6 +418,12 @@ export async function db_save_ae_obj_li__journal_entry(
|
||||
created_on: obj.created_on,
|
||||
updated_on: obj.updated_on,
|
||||
|
||||
// Generated fields for sorting locally only
|
||||
tmp_sort_1: `${obj.group}_${obj.priority}_${obj.sort}_${obj.updated_on}_${obj.created_on}`,
|
||||
tmp_sort_2: `${obj.group}_${obj.priority}_${obj.sort}_${obj.updated_on ?? obj.created_on}`,
|
||||
// tmp_sort_1: `${obj.original_datetime}_${obj.group}_${obj.priority}_${obj.sort}`,
|
||||
// tmp_sort_2: `${obj.group}_${obj.original_datetime}_${obj.priority}_${obj.sort}`,
|
||||
|
||||
// Generated fields for sorting locally only
|
||||
// tmp_sort_1: `${obj.original_datetime}_${obj.group}_${obj.priority}_${obj.sort}`,
|
||||
// tmp_sort_2: `${obj.group}_${obj.original_datetime}_${obj.priority}_${obj.sort}`,
|
||||
|
||||
@@ -151,6 +151,7 @@ export interface Journal_Entry {
|
||||
category_code?: null|string;
|
||||
topic_code?: null|string;
|
||||
type_code?: null|string;
|
||||
tags?: null|string; // Comma separated tags
|
||||
|
||||
journal_entry_type?: null|string; // This is the type of journal entry
|
||||
|
||||
@@ -170,6 +171,7 @@ export interface Journal_Entry {
|
||||
// description?: null|string; // This is the description of the journal entry
|
||||
|
||||
content?: null|string;
|
||||
content_md_html?: null|string; // Markdown converted to HTML based on content
|
||||
content_html?: null|string;
|
||||
content_json?: null|string;
|
||||
|
||||
@@ -211,6 +213,10 @@ export interface Journal_Entry {
|
||||
created_on: Date;
|
||||
updated_on?: null|Date;
|
||||
|
||||
// Generated fields for sorting locally only
|
||||
tmp_sort_1?: null|string;
|
||||
tmp_sort_2?: null|string;
|
||||
|
||||
// Additional fields for convenience (database views)
|
||||
file_count?: null|number; // Only files directly under a journal
|
||||
journal_file_id_li_json?: null|string;
|
||||
|
||||
Reference in New Issue
Block a user