Fix ModelQuery.count()
This commit is contained in:
parent
649fe41be3
commit
28349b791e
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "wms-core",
|
"name": "wms-core",
|
||||||
"version": "0.21.1",
|
"version": "0.21.2",
|
||||||
"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>",
|
||||||
|
@ -223,7 +223,7 @@ export default class ModelQuery<M extends Model> {
|
|||||||
this.fields.splice(0, this.fields.length);
|
this.fields.splice(0, this.fields.length);
|
||||||
this.fields.push('COUNT(*)');
|
this.fields.push('COUNT(*)');
|
||||||
let queryResult = await this.execute(connection);
|
let queryResult = await this.execute(connection);
|
||||||
return queryResult.results.length;
|
return queryResult.results[0]['COUNT(*)'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user