Skip to content

Commit

Permalink
Deleted comments and added deletedAt filtering
Browse files Browse the repository at this point in the history
Deleted Comments and Added deletedAt filtering
  • Loading branch information
kevinzhong930 committed Nov 12, 2024
1 parent e8371d0 commit e5d7cd8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
1 change: 0 additions & 1 deletion devU-api/src/entities/stickyNote/stickyNote.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ export async function put(req: Request, res: Response, next: NextFunction) {
try {
const id = parseInt(req.params.id)
const reqStickyNote = req.body
// const stickyNote = await StickyNoteService.update(reqStickyNote)
const stickyNote = await StickyNoteService.update(id, reqStickyNote)

if (!stickyNote.affected) return res.status(404).json(NotFound)
Expand Down
7 changes: 2 additions & 5 deletions devU-api/src/entities/stickyNote/stickyNote.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,15 @@ export async function update(id : number,stickyNote: StickyNote) {
}

export async function _delete(id: number) {
// return await StickyNoteConn().softDelete({id, deletedAt: IsNull()})
return await StickyNoteConn().softDelete({id, deletedAt: IsNull()})
}

export async function retrieve(id: number) {
// return await StickyNoteConn().findOneBy({id, deletedAt: IsNull()})
return await StickyNoteConn().findOneBy({id})
return await StickyNoteConn().findOneBy({id, deletedAt: IsNull()})
}

export async function listBySubmission(submissionId: number) {
// return await StickyNoteConn().findBy({submissionId :submissionId, deletedAt: IsNull()})
return await StickyNoteConn().findBy({submissionId: submissionId})
return await StickyNoteConn().findBy({submissionId: submissionId , deletedAt: IsNull()})
}

export default {
Expand Down

0 comments on commit e5d7cd8

Please sign in to comment.