Model.select(): allow custom select fields

This commit is contained in:
Alice Gaudon 2020-09-06 15:09:35 +02:00
parent 4c482fb148
commit c2abb1c87a
2 changed files with 3 additions and 3 deletions

View File

@ -1,6 +1,6 @@
{
"name": "wms-core",
"version": "0.22.0-rc.3",
"version": "0.22.0-rc.4",
"description": "Node web application framework and toolbelt.",
"repository": "https://gitlab.com/ArisuOngaku/wms-core",
"author": "Alice Gaudon <alice@gaudon.pro>",

View File

@ -5,7 +5,7 @@ import ModelComponent from "./ModelComponent";
import {Type} from "../Utils";
import ModelFactory from "./ModelFactory";
import ModelRelation from "./ModelRelation";
import ModelQuery, {ModelQueryResult} from "./ModelQuery";
import ModelQuery, {ModelQueryResult, SelectFields} from "./ModelQuery";
import {Request} from "express";
export default abstract class Model {
@ -24,7 +24,7 @@ export default abstract class Model {
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);
}