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:
@ -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;
|
||||
|
||||
@ -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.',
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user