twenty/packages/twenty-server
Félix Malfait cf67ed09d0
Upsert endpoint and CSV import upsert (#5970)
This PR introduces an `upsert` parameter (along the existing `data`
param) for `createOne` and `createMany` mutations.

When upsert is set to `true`, the function will look for records with
the same id if an id was passed. If not id was passed, it will leverage
the existing duplicate check mechanism to find a duplicate. If a record
is found, then the function will perform an update instead of a create.

Unfortunately I had to remove some nice tests that existing on the args
factory. Those tests where mostly testing the duplication rule
generation logic but through a GraphQL angle. Since I moved the
duplication rule logic to a dedicated service, if I kept the tests but
mocked the service we wouldn't really be testing anything useful. The
right path would be to create new tests for this service that compare
the JSON output and not the GraphQL output but I chose not to work on
this as it's equivalent to rewriting the tests from scratch and I have
other competing priorities.
2024-06-26 11:39:16 +02:00
..
@types feat: Enhancements to MessageQueue Module with Decorators (#5657) 2024-06-17 09:49:37 +02:00
patches Fix yoga patch user id cache (#5285) 2024-05-03 18:47:31 +02:00
scripts Uniformize datasources (#5196) 2024-04-27 11:43:44 +02:00
src Upsert endpoint and CSV import upsert (#5970) 2024-06-26 11:39:16 +02:00
test chore: use Nx affected tasks in CI (#5110) 2024-04-30 16:28:25 +02:00
.env.example 5078 ability to invite team members (#5750) 2024-06-05 16:35:14 +02:00
.env.test File token chores (#4664) 2024-03-26 13:42:09 +01:00
.eslintrc.cjs fix: fix storybook:build memory allocation error in CI (#5284) 2024-05-03 19:19:21 +02:00
.gitignore feat: workspace:health nullable fix (#3882) 2024-02-08 18:22:29 +01:00
.prettierignore Migrate to a monorepo structure (#2909) 2023-12-10 18:10:54 +01:00
.prettierrc Migrate to a monorepo structure (#2909) 2023-12-10 18:10:54 +01:00
.swcrc Compile with swc on twenty-server (#4863) 2024-04-14 09:09:51 +02:00
jest.config.ts 4840 multi workspace update user userworkspace inconsistent on delete set null constraint (#5373) 2024-05-13 14:50:27 +02:00
nest-cli.json chore: use Nx affected tasks in CI (#5110) 2024-04-30 16:28:25 +02:00
package.json feat: Enhancements to MessageQueue Module with Decorators (#5657) 2024-06-17 09:49:37 +02:00
project.json Feat/migrate password reset token to app token table (#5051) 2024-05-06 15:30:03 +02:00
tsconfig.build.json chore: set up twenty-emails config so build isn't needed in development (#3619) 2024-01-29 06:17:12 -03:00
tsconfig.json 4586 fix workspace member feature (#4680) 2024-03-28 17:59:48 +01:00