Skip to content

Commit 83faa86

Browse files
committed
Name change
1 parent d8209fb commit 83faa86

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/domain/entities/note.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,9 @@ export interface Note {
8989
export type NoteCreationAttributes = Pick<Note, 'publicId' | 'content' | 'creatorId' | 'tools'>;
9090

9191
/**
92-
* Part of note Hierarchy
92+
* Note preview entity used to display notes in a sidebar hierarchy
9393
*/
94-
export type NoteDAO = {
94+
export type NotePreview = {
9595
/**
9696
* Note id
9797
*/

src/repository/note.repository.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Note, NoteCreationAttributes, NoteInternalId, NotePublicId, NoteDAO } from '@domain/entities/note.js';
1+
import type { Note, NoteCreationAttributes, NoteInternalId, NotePublicId, NotePreview } from '@domain/entities/note.js';
22
import type NoteStorage from '@repository/storage/note.storage.js';
33

44
/**
@@ -94,9 +94,9 @@ export default class NoteRepository {
9494
/**
9595
* Get note and all of its children recursively
9696
* @param noteId - note id
97-
* @returns an array of note DAO
97+
* @returns an array of NotePreview
9898
*/
99-
public async getNoteTreeByNoteId(noteId: NoteInternalId): Promise<NoteDAO[] | null> {
99+
public async getNoteTreeByNoteId(noteId: NoteInternalId): Promise<NotePreview[] | null> {
100100
return await this.storage.getNoteTreebyNoteId(noteId);
101101
}
102102
}

src/repository/storage/postgres/orm/sequelize/note.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { CreationOptional, InferAttributes, InferCreationAttributes, ModelStatic, NonAttribute, Sequelize } from 'sequelize';
22
import { DataTypes, Model, Op, QueryTypes } from 'sequelize';
33
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';
55
import { UserModel } from '@repository/storage/postgres/orm/sequelize/user.js';
66
import type { NoteSettingsModel } from './noteSettings.js';
77
import type { NoteVisitsModel } from './noteVisits.js';
@@ -350,9 +350,9 @@ export default class NoteSequelizeStorage {
350350
/**
351351
* Get note and all of its children recursively
352352
* @param noteId - note id
353-
* @returns an array of note DAO
353+
* @returns an array of NotePreview
354354
*/
355-
public async getNoteTreebyNoteId(noteId: NoteInternalId): Promise<NoteDAO[] | null> {
355+
public async getNoteTreebyNoteId(noteId: NoteInternalId): Promise<NotePreview[] | null> {
356356
// Fetch all notes and relations in a recursive query
357357
const query = `
358358
WITH RECURSIVE note_tree AS (
@@ -387,7 +387,7 @@ export default class NoteSequelizeStorage {
387387
if (!result || result.length === 0) {
388388
return null; // No data found
389389
}
390-
const notes = result as NoteDAO[];
390+
const notes = result as NotePreview[];
391391

392392
return notes;
393393
}

0 commit comments

Comments
 (0)