Skip to content

Commit

Permalink
'.'
Browse files Browse the repository at this point in the history
  • Loading branch information
ManucherKM committed Oct 6, 2023
1 parent ac9b8ef commit 2cd77a7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/file/file.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,11 @@ export class FileService {
}

async findByUserId(userId: string) {
const res = await this.fileModel.find({ userId })
return res.map(item => this.formatFileModel(item.toObject()))
const foundFiles = await this.fileModel.find({ userId })

const foundFilesObject = foundFiles.filter(file => !file.isDeleted)

return foundFilesObject.map(item => this.formatFileModel(item.toObject()))
}

async findById(id: string) {
Expand Down

0 comments on commit 2cd77a7

Please sign in to comment.