4655 batch endpoints on the rest api (#5411)

- add POST rest/batch/<OBJECT> endpoint
- rearrange rest api code with Twenty quality standard
- unify REST API error format
- Added PATCH verb to update objects
- In openapi schema, we replaced PUT with PATCH verb to comply with REST
standard
- fix openApi schema to match the REST api

### Batch Create

![image](https://github.com/twentyhq/twenty/assets/29927851/fe8cd91d-7b35-477f-9077-3477b57b054c)

### Replace PUT by PATCH in open Api

![image](https://github.com/twentyhq/twenty/assets/29927851/9a95060d-0b21-4a04-a3fa-c53390897b5b)

### Error format unification

![image](https://github.com/twentyhq/twenty/assets/29927851/f47dfcef-a4f8-4f93-8504-22f82a8d8057)

![image](https://github.com/twentyhq/twenty/assets/29927851/d76a87e2-2bf6-4ed9-a142-71ad7c123beb)

![image](https://github.com/twentyhq/twenty/assets/29927851/6db59ad3-0ba7-4390-a02d-be15884e2516)
This commit is contained in:
martmull
2024-05-16 14:15:49 +02:00
committed by GitHub
parent ea5a7ba70e
commit fdf10f17e2
90 changed files with 1318 additions and 857 deletions

View File

@ -13,7 +13,7 @@ import { join } from 'path';
import { YogaDriverConfig, YogaDriver } from '@graphql-yoga/nestjs';
import { ApiRestModule } from 'src/engine/api/rest/api-rest.module';
import { RestApiModule } from 'src/engine/api/rest/rest-api.module';
import { ModulesModule } from 'src/modules/modules.module';
import { CoreGraphQLApiModule } from 'src/engine/api/graphql/core-graphql-api.module';
import { MetadataGraphQLApiModule } from 'src/engine/api/graphql/metadata-graphql-api.module';
@ -54,7 +54,7 @@ import { IntegrationsModule } from './engine/integrations/integrations.module';
// Api modules
CoreGraphQLApiModule,
MetadataGraphQLApiModule,
ApiRestModule,
RestApiModule,
// Conditional modules
...AppModule.getConditionalModules(),
],