How to use the @nestjsx/crud/lib/services.CrudService function in @nestjsx/crud

To help you get started, we’ve selected a few @nestjsx/crud examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nestjsx / crud / packages / crud-typeorm / lib / typeorm-crud.service.js View on Github external
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const typeorm_1 = require("typeorm");
const class_transformer_1 = require("class-transformer");
const services_1 = require("@nestjsx/crud/lib/services");
const util_1 = require("@nestjsx/util");
class TypeOrmCrudService extends services_1.CrudService {
    constructor(repo) {
        super();
        this.repo = repo;
        this.entityColumnsHash = {};
        this.entityRelationsHash = {};
        this.onInitMapEntityColumns();
        this.onInitMapRelations();
    }
    get findOne() {
        return this.repo.findOne.bind(this.repo);
    }
    get find() {
        return this.repo.find.bind(this.repo);
    }
    get entityType() {
        return this.repo.target;