Commit 3edb6270 authored by Lorenzo Trujillo Rojas's avatar Lorenzo Trujillo Rojas
Browse files

Merge branch 'main' into 'main'

Agregando traducciones de pueblos

See merge request ltrpro/pueblosmagicosconia!21
parents 88ac563f d759dddf
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@ 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,7 +26,7 @@ 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,
    }),
    AuthAdminModule,
+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;
+14 −0
Original line number Diff line number Diff line
import { Entity, Column, OneToOne, PrimaryColumn } from 'typeorm';
import { Town } from './town.entity';
import { LANGUAGES } from 'src/enum/languages.enum';
@Entity()
export class TownTraduction {
  @PrimaryColumn()
  @OneToOne(() => Town, (town) => town.townId)
  townId: number;
  @PrimaryColumn()
  language: LANGUAGES;

  @Column()
  description: string;
}
Loading