mirror of
https://github.com/twentyhq/twenty.git
synced 2024-11-30 03:43:02 +03:00
7b96be6f8c
In this PR, I'm fixing part of the impact of soft deletion on optimistic rendering. ## Backend Vision 1) Backend endpoints will not return soft deleted records (having deletedAt set) by default. To get the softDeleted records, we will pass a { withSoftDelete: true } additional param in the query. 2) Record relations will NEVER contain softDeleted relations ## Backend current state Right now, we have the following behavior: - if the query filters do not mention deletedAt, we don't return softDeletedRecords - if the query filters mention deletedAt, we take it into consideration. Meaning that if we want to have the softDeleted records in any way we need to do { or: [ deletedAt: NULL, deletedAt: NOT_NULL] } ## Optimistic rendering strategy 1) useDestroyOne/Many is triggering destroyOptimisticEffects (previously deleteOptimisticEffects) 2) UseDeleteOne/Many and useRestoreOne/Many are actually triggering updateOptimisticEffects (as they only update deletedAt field) AND we need updateOptimisticEffects to take into account deletedAt (future withSoftDelete: true) filter. |
||
---|---|---|
.. | ||
@types | ||
patches | ||
scripts | ||
src | ||
test | ||
.env.example | ||
.env.test | ||
.eslintrc.cjs | ||
.gitignore | ||
.prettierignore | ||
.prettierrc | ||
.swcrc | ||
jest-integration.config.ts | ||
jest.config.ts | ||
nest-cli.json | ||
package.json | ||
project.json | ||
tsconfig.build.json | ||
tsconfig.json | ||
tsconfig.scripts.json |