This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { NestFactory } from '@nestjs/core'; | |
import { config } from 'dotenv'; | |
config(); | |
import { CustomExceptionFilter } from './exeptions/custom-exception.filter'; | |
import { AppModule } from './app/app.module'; | |
import * as compression from 'compression'; | |
import * as express from 'express' | |
import * as cors from 'cors'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async updateEvent(layerId, eventId, eventInstance) { | |
try { | |
if (!layerId) throw new Error('Не задан id слоя'); | |
if (!eventId) throw new Error('Не задан id события'); | |
let schema: any = await Layers.findById(layerId); | |
if (!schema) throw new Error('Слой не существует'); | |
let eventsTableName = schema.toJSON().layer_schema.eventsTable; | |
if (!eventsTableName) throw new Error('У слоя нет таблицы событий'); | |
let eventsTable = this.generateEventsModel(schema, eventsTableName); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class users_layers extends Model<users_layers> { | |
@AutoIncrement | |
@PrimaryKey | |
@Column(DataType.INTEGER) | |
id: number; | |
@ForeignKey(() => users) | |
@Column(DataType.CHAR(100)) | |
@BelongsTo(() => users) | |
user_id: string; |