Open qiuzuhui opened 3 years ago
I have the same issue, @michaelyali what is the purpose of using library "@zmotivat0r/o0"? Would it be ok to replace this line:
to something like the code in the "updateOne" which throws the "Not Found" error when the resource doesn't belong to the user? Like here:
Currently I'm using CrudAuth to fitler the resource belong to user as following:
@CrudAuth({ property: 'user', filter: (user) => { console.log(user.id); return { ownerId: user.id, }; }, persist: (user) => ({ ownerId: user.id }), })
When i send a PUT request to update a resource which is belong to another user. (supposed it will return not found ), but it replace the record which it not belong to this user.
https://github.com/nestjsx/crud/blob/bbea082a3f0fc7c1be42a79164f41b8449ad2251/packages/crud-typeorm/src/typeorm-crud.service.ts#L215
Here ignored the NotFound error ( belong to other user ) and save record.