Model.select(): allow custom select fields
This commit is contained in:
parent
4c482fb148
commit
c2abb1c87a
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "wms-core",
|
"name": "wms-core",
|
||||||
"version": "0.22.0-rc.3",
|
"version": "0.22.0-rc.4",
|
||||||
"description": "Node web application framework and toolbelt.",
|
"description": "Node web application framework and toolbelt.",
|
||||||
"repository": "https://gitlab.com/ArisuOngaku/wms-core",
|
"repository": "https://gitlab.com/ArisuOngaku/wms-core",
|
||||||
"author": "Alice Gaudon <alice@gaudon.pro>",
|
"author": "Alice Gaudon <alice@gaudon.pro>",
|
||||||
|
@ -5,7 +5,7 @@ import ModelComponent from "./ModelComponent";
|
|||||||
import {Type} from "../Utils";
|
import {Type} from "../Utils";
|
||||||
import ModelFactory from "./ModelFactory";
|
import ModelFactory from "./ModelFactory";
|
||||||
import ModelRelation from "./ModelRelation";
|
import ModelRelation from "./ModelRelation";
|
||||||
import ModelQuery, {ModelQueryResult} from "./ModelQuery";
|
import ModelQuery, {ModelQueryResult, SelectFields} from "./ModelQuery";
|
||||||
import {Request} from "express";
|
import {Request} from "express";
|
||||||
|
|
||||||
export default abstract class Model {
|
export default abstract class Model {
|
||||||
@ -24,7 +24,7 @@ export default abstract class Model {
|
|||||||
return ModelFactory.get(this).create(data, true);
|
return ModelFactory.get(this).create(data, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static select<T extends Model>(this: ModelType<T>, ...fields: string[]): ModelQuery<T> {
|
public static select<T extends Model>(this: ModelType<T>, ...fields: SelectFields): ModelQuery<T> {
|
||||||
return ModelFactory.get(this).select(...fields);
|
return ModelFactory.get(this).select(...fields);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user