Skip to content
This repository has been archived by the owner on Dec 23, 2021. It is now read-only.

Commit

Permalink
fix: build script
Browse files Browse the repository at this point in the history
  • Loading branch information
Soontao committed Aug 1, 2020
1 parent 445adcd commit a56ba53
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/lib/typeorm/model.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
import { BaseEntity, getConnection, Repository } from 'typeorm';
import { getControllerInstance } from '../controller';
import { getPublicControllers } from '../odata';
import { ODataHttpContext } from '../server';
import { getConnectionName } from './connection';
import { getEntityController, TypedService } from './controller';
import { TypedService } from './controller';
import { getODataEntitySetName } from './decorators';
import { getODataServerType } from './server';
import { getOrCreateTransaction } from './transaction';

export class BaseODataModel extends BaseEntity {

protected _gerService<E extends typeof BaseODataModel>(entity: E): TypedService<E> {
return getEntityController(entity);
const serverType = getODataServerType(this.constructor);
const controllers = getPublicControllers(serverType);
const entitySetName = getODataEntitySetName(entity);
// @ts-ignore
return getControllerInstance(controllers[entitySetName]);
};

protected async _getConnection(ctx: ODataHttpContext) {
Expand Down

0 comments on commit a56ba53

Please sign in to comment.