Commit af31a702 authored by Lorenzo Trujillo Rojas's avatar Lorenzo Trujillo Rojas
Browse files

Merge branch pueblosmagicosconia:main into main

parents 854d2fb8 15d43330
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@ import { ServeStaticModule } from '@nestjs/serve-static';
import { join } from 'path';
import { Town } from './town/entities/town.entity';
import { TownModule } from './town/town.module';
import { TownTraduction } from './town/entities/town-traduction.entity';

@Module({
  imports: [
    TypeOrmModule.forRoot({
@@ -25,8 +27,9 @@ import { TownModule } from './town/town.module';
      username: DbConstants.DB_USER,
      password: DbConstants.DB_PASSWORD,
      database: DbConstants.DB_NAME,
      entities: [Admin, User, State, Town],
      entities: [Admin, User, State, Town, TownTraduction],
      synchronize: DbConstants.DB_SYNC,
      logging: true,
    }),
    AuthAdminModule,
    AdminModule,
@@ -41,5 +44,6 @@ import { TownModule } from './town/town.module';
  ],
  controllers: [AppController],
  providers: [AppService, DatabaseSeederModule],
  exports: [TypeOrmModule],
})
export class AppModule {}
+2 −1
Original line number Diff line number Diff line
@@ -3,9 +3,10 @@ import { DatabaseSeederService } from './database-seeder.service';
import { TypeOrmModule } from '@nestjs/typeorm';
import { State } from 'src/state/entities/state.entity';
import { StateService } from 'src/state/state.service';
import { Town } from 'src/town/entities/town.entity';

@Module({
  providers: [DatabaseSeederService, StateService],
  imports: [TypeOrmModule.forFeature([State])],
  imports: [TypeOrmModule.forFeature([State, Town])],
})
export class DatabaseSeederModule {}
+4 −0
Original line number Diff line number Diff line
export enum LANGUAGES {
  EN = 'en',
  ES = 'es',
}
+8 −0
Original line number Diff line number Diff line
import { LANGUAGES } from 'src/enum/languages.enum';

export class CreateTownTraductionDto {
  townId: number;
  language: LANGUAGES;
  name: string;
  description: string;
}
+12 −2
Original line number Diff line number Diff line
@@ -3,8 +3,18 @@ import { ApiProperty } from '@nestjs/swagger';
export class CreateTownDto {
  @ApiProperty()
  name: string;
  @ApiProperty()
  description: string;

  @ApiProperty({
    type: String,
    description: 'Language content for Spanish (es)',
  })
  descriptionES: string;

  @ApiProperty({
    type: String,
    description: 'Language content for English (en)',
  })
  descriptionEN: string;
  imageName: string = 'default.jpg';
  @ApiProperty()
  state: number;
Loading