Make id available in remote table output (#5003)

Wrongly use `PrimaryGeneratedColumn` typeOrm decorator instead of the
nest query one.

Co-authored-by: Thomas Trompette <thomast@twenty.com>
This commit is contained in:
Thomas Trompette
2024-04-17 17:05:47 +02:00
committed by GitHub
parent 979b8d29cc
commit 6cf3ade300
6 changed files with 19 additions and 15 deletions

View File

@ -1,7 +1,9 @@
import { ObjectType, Field, registerEnumType } from '@nestjs/graphql';
import { IDField } from '@ptc-org/nestjs-query-graphql';
import { IsEnum } from 'class-validator';
import { PrimaryGeneratedColumn } from 'typeorm';
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
export enum RemoteTableStatus {
SYNCED = 'SYNCED',
@ -15,8 +17,8 @@ registerEnumType(RemoteTableStatus, {
@ObjectType('RemoteTable')
export class RemoteTableDTO {
@PrimaryGeneratedColumn('uuid')
id: string;
@IDField(() => UUIDScalarType, { nullable: true })
id?: string;
@Field(() => String)
name: string;

View File

@ -397,7 +397,7 @@ export class RemoteTableService {
this.workspaceMigrationService.deleteById(workspaceMigration.id);
throw new BadRequestException(
'Could not create foreign table. Please check if the table already exists.',
'Could not create foreign table. The table may already exists or a column type may not be supported.',
);
}
}