nestjsx / crud

NestJs CRUD for RESTful APIs
https://github.com/nestjsx/crud/wiki
MIT License
4.04k stars 533 forks source link

req.parsed.authPersist in data to updateOne and replaceOne #709

Closed ArcheoCodix closed 2 years ago

ArcheoCodix commented 3 years ago

Hello,

Why destructuring req.parsed.authPersist in data to update ? In our case, we use authPersist to have logged in user information. But, when update Customer or other data, it doesn't make sense to add it.

const toSave = !allowParamsOverride
            ? { ...found, ...dto, ...paramsFilters, ...req.parsed.authPersist }
            : { ...found, ...dto, ...req.parsed.authPersist };

Thank you for your time.