diff --git a/packages/backend/src/models/repositories/note.ts b/packages/backend/src/models/repositories/note.ts index 26d4d9e508..8ede9684d1 100644 --- a/packages/backend/src/models/repositories/note.ts +++ b/packages/backend/src/models/repositories/note.ts @@ -196,7 +196,6 @@ export const NoteRepository = db.getRepository(Note).extend({ const meId = me ? me.id : null; let note: Note | null = null; - let foundScyllaNote = false; const isSrcNote = typeof src === "object"; // Always lookup from ScyllaDB if enabled @@ -212,11 +211,8 @@ export const NoteRepository = db.getRepository(Note).extend({ ); if (result.rowLength > 0) { note = parseScyllaNote(result.first()); - foundScyllaNote = true; } - } - if (!foundScyllaNote) { - // Fallback to Postgres + } else { note = await this.findOneBy({ id: noteId }); } } diff --git a/packages/backend/src/server/api/common/getters.ts b/packages/backend/src/server/api/common/getters.ts index 09595c2b27..bf136d2970 100644 --- a/packages/backend/src/server/api/common/getters.ts +++ b/packages/backend/src/server/api/common/getters.ts @@ -33,10 +33,7 @@ export async function getNote( note = filtered[0]; } } - } - - // Fallback to Postgres - if (!note) { + } else { const query = Notes.createQueryBuilder("note").where("note.id = :id", { id: noteId, });