diff --git a/src/presentation/http/router/note.test.ts b/src/presentation/http/router/note.test.ts index 97428b76..b4aa3cd7 100644 --- a/src/presentation/http/router/note.test.ts +++ b/src/presentation/http/router/note.test.ts @@ -13,7 +13,7 @@ describe('Note API', () => { 'content': null, 'createdAt': '2023-10-16T13:49:19.000Z', 'updatedAt': '2023-10-16T13:49:19.000Z', - 'notesSettings': { + 'noteSettings': { 'custom_hostname': 'codex.so', 'enabled': true, 'id': 1, diff --git a/src/repository/storage/postgres/orm/sequelize/note.ts b/src/repository/storage/postgres/orm/sequelize/note.ts index 08c00c30..aa80d244 100644 --- a/src/repository/storage/postgres/orm/sequelize/note.ts +++ b/src/repository/storage/postgres/orm/sequelize/note.ts @@ -120,7 +120,7 @@ export default class NoteSequelizeStorage { */ this.model.hasOne(this.settingsModel, { foreignKey: 'note_id', - as: 'notesSettings', + as: 'noteSettings', }); } @@ -217,11 +217,11 @@ export default class NoteSequelizeStorage { */ return await this.model.findOne({ where: { - '$notesSettings.custom_hostname$': hostname, + '$noteSettings.custom_hostname$': hostname, }, include: { model: this.settingsModel, - as: 'notesSettings', + as: 'noteSettings', required: true, }, });