diff --git a/package.json b/package.json index 195403f..9464529 100644 --- a/package.json +++ b/package.json @@ -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 ", diff --git a/src/db/ModelQuery.ts b/src/db/ModelQuery.ts index 504fadf..e190edd 100644 --- a/src/db/ModelQuery.ts +++ b/src/db/ModelQuery.ts @@ -223,7 +223,7 @@ export default class ModelQuery { 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(*)']; } }