Skip to content

Commit

Permalink
fix(int-field): fixes (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
goldcaddy77 authored Feb 13, 2019
1 parent 4cb499d commit d91d464
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 1 addition & 3 deletions src/decorators/IntField.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ interface IntFieldOptions {

export function IntField(args: IntFieldOptions = {}): any {
const nullableOption = args.nullable === true ? { nullable: true } : {};
const uniqueOption = args.unique ? { unique: true } : {};

// These are the 2 required decorators to get type-graphql and typeorm working
const factories = [
Expand All @@ -21,8 +20,7 @@ export function IntField(args: IntFieldOptions = {}): any {
}),
Column({
type: 'int',
...nullableOption,
...uniqueOption
...nullableOption
}) as MethodDecoratorFactory
];

Expand Down
1 change: 1 addition & 0 deletions src/schema/TypeORMConverter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ export function columnToTypeScriptType(column: ColumnMetadata): string {
const typeMap: any = {
DateTime: 'string',
ID: 'string', // TODO: should this be ID_TYPE?
Int: 'number',
String: 'string'
};

Expand Down

0 comments on commit d91d464

Please sign in to comment.