5581 get httpsapitwentycomrestmetadata relations not working (#5867)
Filtering relations is not allowed (see`packages/twenty-server/src/engine/metadata-modules/relation-metadata/dtos/relation-metadata.dto.ts`) so we remove filtering for find many relation we also fixed some bug in result structure and metadata open-api schema
This commit is contained in:
@ -24,28 +24,28 @@ export class RestApiMetadataController {
|
||||
async handleApiGet(@Req() request: Request, @Res() res: Response) {
|
||||
const result = await this.restApiMetadataService.get(request);
|
||||
|
||||
res.status(200).send(cleanGraphQLResponse(result.data));
|
||||
res.status(200).send(cleanGraphQLResponse(result.data.data));
|
||||
}
|
||||
|
||||
@Delete()
|
||||
async handleApiDelete(@Req() request: Request, @Res() res: Response) {
|
||||
const result = await this.restApiMetadataService.delete(request);
|
||||
|
||||
res.status(200).send(cleanGraphQLResponse(result.data));
|
||||
res.status(200).send(cleanGraphQLResponse(result.data.data));
|
||||
}
|
||||
|
||||
@Post()
|
||||
async handleApiPost(@Req() request: Request, @Res() res: Response) {
|
||||
const result = await this.restApiMetadataService.create(request);
|
||||
|
||||
res.status(201).send(cleanGraphQLResponse(result.data));
|
||||
res.status(201).send(cleanGraphQLResponse(result.data.data));
|
||||
}
|
||||
|
||||
@Patch()
|
||||
async handleApiPatch(@Req() request: Request, @Res() res: Response) {
|
||||
const result = await this.restApiMetadataService.update(request);
|
||||
|
||||
res.status(200).send(cleanGraphQLResponse(result.data));
|
||||
res.status(200).send(cleanGraphQLResponse(result.data.data));
|
||||
}
|
||||
|
||||
// This endpoint is not documented in the OpenAPI schema.
|
||||
@ -55,6 +55,6 @@ export class RestApiMetadataController {
|
||||
async handleApiPut(@Req() request: Request, @Res() res: Response) {
|
||||
const result = await this.restApiMetadataService.update(request);
|
||||
|
||||
res.status(200).send(cleanGraphQLResponse(result.data));
|
||||
res.status(200).send(cleanGraphQLResponse(result.data.data));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user