Limit rest api relations depth to 1 (#14453)
Until we tackle [Implement relations depth 2 for rest api](https://github.com/twentyhq/twenty/issues/14452), let's remove the depth 2 query parameter which is not working (times out all the time).
This commit is contained in:
+1
-1
@@ -1,7 +1,7 @@
|
||||
import { computeDepth } from 'src/engine/api/rest/core/query-builder/utils/compute-depth.utils';
|
||||
|
||||
describe('computeDepth', () => {
|
||||
[0, 1, 2].forEach((depth) => {
|
||||
[0, 1].forEach((depth) => {
|
||||
it('should compute depth from query', () => {
|
||||
const request: any = {
|
||||
query: { depth: `${depth}` },
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ import { BadRequestException } from '@nestjs/common';
|
||||
|
||||
import { type Request } from 'express';
|
||||
|
||||
const ALLOWED_DEPTH_VALUES = [0, 1, 2];
|
||||
const ALLOWED_DEPTH_VALUES = [0, 1];
|
||||
|
||||
export const computeDepth = (request: Request): number | undefined => {
|
||||
if (!request.query.depth) {
|
||||
|
||||
@@ -6,7 +6,7 @@ export const MAX_DEPTH = 2;
|
||||
|
||||
export type Depth = 0 | 1 | 2;
|
||||
|
||||
const ALLOWED_DEPTH_VALUES: Depth[] = [0, 1, MAX_DEPTH];
|
||||
const ALLOWED_DEPTH_VALUES: Depth[] = [0, 1];
|
||||
|
||||
@Injectable()
|
||||
export class DepthInputFactory {
|
||||
|
||||
Reference in New Issue
Block a user