|
1 | 1 | import type { CreationOptional, InferAttributes, InferCreationAttributes, ModelStatic, NonAttribute, Sequelize } from 'sequelize'; |
2 | 2 | import { DataTypes, Model, Op, QueryTypes } from 'sequelize'; |
3 | 3 | import type Orm from '@repository/storage/postgres/orm/sequelize/index.js'; |
4 | | -import type { Note, NoteCreationAttributes, NoteInternalId, NotePublicId, NoteDAO } from '@domain/entities/note.js'; |
| 4 | +import type { Note, NoteCreationAttributes, NoteInternalId, NotePublicId, NotePreview } from '@domain/entities/note.js'; |
5 | 5 | import { UserModel } from '@repository/storage/postgres/orm/sequelize/user.js'; |
6 | 6 | import type { NoteSettingsModel } from './noteSettings.js'; |
7 | 7 | import type { NoteVisitsModel } from './noteVisits.js'; |
@@ -350,9 +350,9 @@ export default class NoteSequelizeStorage { |
350 | 350 | /** |
351 | 351 | * Get note and all of its children recursively |
352 | 352 | * @param noteId - note id |
353 | | - * @returns an array of note DAO |
| 353 | + * @returns an array of NotePreview |
354 | 354 | */ |
355 | | - public async getNoteTreebyNoteId(noteId: NoteInternalId): Promise<NoteDAO[] | null> { |
| 355 | + public async getNoteTreebyNoteId(noteId: NoteInternalId): Promise<NotePreview[] | null> { |
356 | 356 | // Fetch all notes and relations in a recursive query |
357 | 357 | const query = ` |
358 | 358 | WITH RECURSIVE note_tree AS ( |
@@ -387,7 +387,7 @@ export default class NoteSequelizeStorage { |
387 | 387 | if (!result || result.length === 0) { |
388 | 388 | return null; // No data found |
389 | 389 | } |
390 | | - const notes = result as NoteDAO[]; |
| 390 | + const notes = result as NotePreview[]; |
391 | 391 |
|
392 | 392 | return notes; |
393 | 393 | } |
|
0 commit comments