Fix ModelQuery.count()

This commit is contained in:
Alice Gaudon 2020-08-30 13:31:06 +02:00
parent 649fe41be3
commit 28349b791e
2 changed files with 2 additions and 2 deletions

View File

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

View File

@ -223,7 +223,7 @@ export default class ModelQuery<M extends Model> {
this.fields.splice(0, this.fields.length);
this.fields.push('COUNT(*)');
let queryResult = await this.execute(connection);
return queryResult.results.length;
return queryResult.results[0]['COUNT(*)'];
}
}