mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-28 02:22:26 +08:00
fix the table reference
This commit is contained in:
parent
e5aab5bc04
commit
0bca44f8e0
@ -130,9 +130,9 @@ export class ChatStorageService {
|
||||
*/
|
||||
async getAllChats(): Promise<StoredChat[]> {
|
||||
const chats = await sql.getRows<{noteId: string, title: string, dateCreated: string, dateModified: string, content: string}>(
|
||||
`SELECT notes.noteId, notes.title, notes.dateCreated, notes.dateModified, note_contents.content
|
||||
`SELECT notes.noteId, notes.title, notes.dateCreated, notes.dateModified, blobs.content
|
||||
FROM notes
|
||||
JOIN note_contents ON notes.noteId = note_contents.noteId
|
||||
JOIN blobs ON notes.blobId = blobs.blobId
|
||||
JOIN attributes ON notes.noteId = attributes.noteId
|
||||
WHERE attributes.name = ? AND attributes.value = ?
|
||||
ORDER BY notes.dateModified DESC`,
|
||||
@ -178,9 +178,9 @@ export class ChatStorageService {
|
||||
*/
|
||||
async getChat(chatId: string): Promise<StoredChat | null> {
|
||||
const chat = await sql.getRow<{noteId: string, title: string, dateCreated: string, dateModified: string, content: string}>(
|
||||
`SELECT notes.noteId, notes.title, notes.dateCreated, notes.dateModified, note_contents.content
|
||||
`SELECT notes.noteId, notes.title, notes.dateCreated, notes.dateModified, blobs.content
|
||||
FROM notes
|
||||
JOIN note_contents ON notes.noteId = note_contents.noteId
|
||||
JOIN blobs ON notes.blobId = blobs.blobId
|
||||
WHERE notes.noteId = ?`,
|
||||
[chatId]
|
||||
);
|
||||
@ -247,7 +247,7 @@ export class ChatStorageService {
|
||||
|
||||
// Update content directly using SQL since we don't have a method for this in the notes service
|
||||
await sql.execute(
|
||||
`UPDATE note_contents SET content = ? WHERE noteId = ?`,
|
||||
`UPDATE blobs SET content = ? WHERE blobId = (SELECT blobId FROM notes WHERE noteId = ?)`,
|
||||
[JSON.stringify({
|
||||
messages,
|
||||
metadata: updatedMetadata,
|
||||
|
Loading…
x
Reference in New Issue
Block a user