Skip to content

Commit

Permalink
#5 Minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jonatansalas committed Jul 1, 2017
1 parent 9b3b83b commit 2420229
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 17 deletions.
4 changes: 2 additions & 2 deletions src/api/users/controller.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as Hapi from 'hapi';
import * as Boom from 'boom';
import Database from "../../database";
import Database from '../../database';

import {User} from '../../model/user';
import { User } from '../../model/user';
import Utils from '../../helper/utils';
import Logger from '../../helper/logger';
import Repository from '../../repository';
Expand Down
6 changes: 2 additions & 4 deletions src/database.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Connection, createConnection} from "typeorm";
import { Connection, createConnection } from 'typeorm';

import Logger from './helper/logger';

Expand All @@ -16,9 +16,7 @@ export default class Database {
password: process.env.POSTGRES_PASSWORD,
database: process.env.POSTGRES_DB,
},
entities: [
__dirname + "/model/*.ts",
],
entities: [__dirname + '/model/*.ts'],
autoSchemaSync: true,
});
} catch (error) {
Expand Down
17 changes: 6 additions & 11 deletions src/model/user.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
import {Entity} from "typeorm/decorator/entity/Entity";
import {Column, PrimaryGeneratedColumn} from "typeorm";
import { Entity } from 'typeorm/decorator/entity/Entity';
import { Column, PrimaryGeneratedColumn } from 'typeorm';

@Entity()
export class User {
@PrimaryGeneratedColumn() public id: number;

@PrimaryGeneratedColumn()
public id: number;
@Column() public age: string;

@Column()
public age: string;
@Column() public name: string;

@Column()
public name: string;

@Column()
public lastName: string;
@Column() public lastName: string;
}

0 comments on commit 2420229

Please sign in to comment.