|
|
|
@ -107,14 +107,20 @@ async function getDataList(model, view: View, req) {
|
|
|
|
|
listArgs.sortArr = JSON.parse(listArgs.sortArrJson); |
|
|
|
|
} catch (e) {} |
|
|
|
|
|
|
|
|
|
const data = await nocoExecute( |
|
|
|
|
requestObj, |
|
|
|
|
await baseModel.list(listArgs), |
|
|
|
|
{}, |
|
|
|
|
listArgs |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
const count = await baseModel.count(listArgs); |
|
|
|
|
let data = []; |
|
|
|
|
let count = 0; |
|
|
|
|
try { |
|
|
|
|
data = await nocoExecute( |
|
|
|
|
requestObj, |
|
|
|
|
await baseModel.list(listArgs), |
|
|
|
|
{}, |
|
|
|
|
listArgs |
|
|
|
|
); |
|
|
|
|
count = await baseModel.count(listArgs); |
|
|
|
|
} catch (_) { |
|
|
|
|
// show empty result instead of throwing error here
|
|
|
|
|
// e.g. search some text in a numeric field
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return new PagedResponseImpl(data, { |
|
|
|
|
...req.query, |
|
|
|
|