mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: record_list: add projection
This commit is contained in:
1 parent
36f356340c
commit
99ddb9c92e
2 files changed
+14
-5
No files matched your search
@@ -13,6 +13,7 @@ import * as bus from '../service/bus';
|
||||
import {
|
||||
Route, Handler, Connection, ConnectionHandler, Types, param,
|
||||
} from '../service/server';
|
||||
import { buildProjection } from '../utils';
|
||||
|
||||
class RecordListHandler extends Handler {
|
||||
@param('page', Types.PositiveInt, true)
|
||||
@@ -45,7 +46,7 @@ class RecordListHandler extends Handler {
|
||||
}
|
||||
if (status) q.status = status;
|
||||
const [rdocs] = await paginate(
|
||||
record.getMulti(domainId, q).sort('_id', -1),
|
||||
record.getMulti(domainId, q).sort('_id', -1).project(buildProjection(record.PROJECTION_LIST)),
|
||||
page,
|
||||
system.get('pagination.record'),
|
||||
);
|
||||
@@ -70,6 +71,7 @@ class RecordListHandler extends Handler {
|
||||
filterPid: pid,
|
||||
filterTid: tid,
|
||||
filterUidOrName: uidOrName,
|
||||
filterStatus: status,
|
||||
};
|
||||
if (this.user.hasPriv(PRIV.PRIV_VIEW_JUDGE_STATISTICS)) {
|
||||
this.response.body.statistics = {
|
||||
|
||||
Reference in new issue
Block a user