Skip to content

Commit

Permalink
type errors fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
e11sy committed Oct 21, 2023
1 parent a5097f5 commit 58f0c4c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/domain/service/note.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ export default class NoteService {

/**
* Deletes note by id
*
* @param id - note internal id
* @returns { Promise<boolean | null> }
*/
public async deleteNoteById(id: NoteInternalId){
public async deleteNoteById(id: NoteInternalId): Promise<boolean> {
return await this.repository.deleteNoteById(id);
}

Expand Down
9 changes: 4 additions & 5 deletions src/repository/note.repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,12 @@ export default class NoteRepository {
}

/**
* Deletes note by id
*
* Deletes note by id
*
* @param id - note id
* @returns { Promise<boolean | null> }
*/
public async deleteNoteById(id: NoteInternalId){
return await this.storage.deleteNoteById(id)
public async deleteNoteById(id: NoteInternalId): Promise<boolean> {
return await this.storage.deleteNoteById(id);
}

/**
Expand Down
11 changes: 5 additions & 6 deletions src/repository/storage/postgres/orm/sequelize/note.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,24 +188,23 @@ export default class NoteSequelizeStorage {

/**
* Deletes note by id
*
*
* @param id - internal id
* @returns { Promise<boolean> }
*/
public async deleteNoteById(id: NoteInternalId){
public async deleteNoteById(id: NoteInternalId): Promise<boolean> {
const note = await this.model.destroy({
where:{
id,
}
})
},
});

/**
* If note not found, return null
*/
if (!note) {
return false;
}
else{
else {
return true;
}
}
Expand Down

0 comments on commit 58f0c4c

Please sign in to comment.