adonis-mqrepository
Advanced tools
Comparing version 1.0.8 to 1.0.9
{ | ||
"name": "adonis-mqrepository", | ||
"version": "1.0.8", | ||
"version": "1.0.9", | ||
"private": false, | ||
"main": "./BaseRepository.js" | ||
} |
@@ -42,4 +42,4 @@ 'use strict' | ||
conditions = {} | ||
if(startDate) conditions["$gte"] = moment(startDate).toISOString() | ||
if(endDate) conditions["$lt"] = moment(endDate).add(1,"d").toISOString() | ||
if(startDate) conditions["$gte"] = moment(startDate).toDate() | ||
if(endDate) conditions["$lt"] = moment(endDate).add(1,"d").toDate() | ||
break; | ||
@@ -64,3 +64,3 @@ } | ||
for(let filter of filters) { // foreach mảng filters | ||
filter = JSON.parse(filter) // chuyển filter thành json để lấy ID và value | ||
if(typeof filter == "string") filter = JSON.parse(filter) // chuyển filter thành json để lấy ID và value | ||
if (filter.id) { | ||
@@ -78,3 +78,3 @@ try{ | ||
else if(type == "moment"){ | ||
conditions[filter.id] = {$lte: new Date(filter.value).toISOString()} | ||
conditions[filter.id] = {$eq: new Date(filter.value)} | ||
} | ||
@@ -106,3 +106,3 @@ else if(this.Repository.model.objectIDs.includes(filter.id) || type == "objectid"){ | ||
sorts.forEach((sort) => { // foreach mảng sorts | ||
sort = JSON.parse(sort) // chuyển filter thành json để lấy ID và value | ||
if(typeof sort == "string") sort = JSON.parse(sort) // chuyển filter thành json để lấy ID và value | ||
if (sort.id) { | ||
@@ -121,3 +121,3 @@ sortCondition[sort.id] = sort.desc ? -1 : 1 | ||
*/ | ||
async getForReactTable (params, column = {}) { | ||
async getForReactTable (params, column) { | ||
let {pageSize, page, sorted, filtered} = params | ||
@@ -124,0 +124,0 @@ filtered = filtered || [] // lấy giá trị filters của table |
14122