Skip to content

Commit 837de3c

Browse files
committed
Changed from NoteRow to NoteDAO
1 parent 6b4b121 commit 837de3c

4 files changed

Lines changed: 8 additions & 8 deletions

File tree

src/domain/entities/note.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export type NoteCreationAttributes = Pick<Note, 'publicId' | 'content' | 'creato
9191
/**
9292
* Part of note Hierarchy
9393
*/
94-
export type NoteRow = {
94+
export type NoteDAO = {
9595
/**
9696
* Note id
9797
*/

src/domain/service/note.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ export default class NoteService {
466466
// If there is no ultimate parent, the provided noteId is the ultimate parent
467467
const rootNoteId = ultimateParent ?? noteId;
468468

469-
const notesRows = await this.noteRepository.getNoteRowByNoteId(rootNoteId);
469+
const notesRows = await this.noteRepository.getNoteDAOByNoteId(rootNoteId);
470470

471471
const notesMap = new Map<NoteInternalId, NoteHierarchy>();
472472

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, NoteRow } from '@domain/entities/note.js';
1+
import type { Note, NoteCreationAttributes, NoteInternalId, NotePublicId, NoteDAO } from '@domain/entities/note.js';
22
import type NoteStorage from '@repository/storage/note.storage.js';
33

44
/**
@@ -96,7 +96,7 @@ export default class NoteRepository {
9696
* @param noteId - note id
9797
* @returns an array of note rows
9898
*/
99-
public async getNoteRowByNoteId(noteId: NoteInternalId): Promise<NoteRow[] | null> {
100-
return await this.storage.getNoteRowbyNoteId(noteId);
99+
public async getNoteDAOByNoteId(noteId: NoteInternalId): Promise<NoteDAO[] | null> {
100+
return await this.storage.getNoteDAObyNoteId(noteId);
101101
}
102102
}

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

Lines changed: 3 additions & 3 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, NoteRow } from '@domain/entities/note.js';
4+
import type { Note, NoteCreationAttributes, NoteInternalId, NotePublicId, NoteDAO } 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';
@@ -352,7 +352,7 @@ export default class NoteSequelizeStorage {
352352
* @param noteId - note id
353353
* @returns an array of note rows
354354
*/
355-
public async getNoteRowbyNoteId(noteId: NoteInternalId): Promise<NoteRow[] | null> {
355+
public async getNoteDAObyNoteId(noteId: NoteInternalId): Promise<NoteDAO[] | 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 NoteRow[];
390+
const notes = result as NoteDAO[];
391391

392392
return notes;
393393
}

0 commit comments

Comments
 (0)