@openinc/parse-server-opendash 2.4.35 → 2.4.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -13,12 +13,12 @@ async function init(name) {
|
|
|
13
13
|
const limit = request.params?.limit || 10;
|
|
14
14
|
const state = new Parse.Query(types_1.Maintenance_Kanban_State).get(request.params?.state);
|
|
15
15
|
const currentPagePipeline = [
|
|
16
|
-
{ group: { _id: "ticket", doc: { $first: "$$ROOT" } } }, // Group by ticket to only get the latest state of the ticket
|
|
17
|
-
{ match: { state: state } }, // only get tickets with the state provided
|
|
18
|
-
{ sort: { createdAt: 1 } }, // sort by createdAt
|
|
19
|
-
{ match: { createdAt: { $lt: new Date(cursor) } } }, // only get tickets with createdAt less than the cursor => pagination
|
|
20
|
-
{ limit: limit }, // limit the number of tickets recieved
|
|
21
|
-
{ replaceRoot: { newRoot: "$doc" } }, // replace the root of the document with the ticket
|
|
16
|
+
{ $group: { _id: "ticket", doc: { $first: "$$ROOT" } } }, // Group by ticket to only get the latest state of the ticket
|
|
17
|
+
{ $match: { state: state } }, // only get tickets with the state provided
|
|
18
|
+
{ $sort: { createdAt: 1 } }, // sort by createdAt
|
|
19
|
+
{ $match: { createdAt: { $lt: new Date(cursor) } } }, // only get tickets with createdAt less than the cursor => pagination
|
|
20
|
+
{ $limit: limit }, // limit the number of tickets recieved
|
|
21
|
+
{ $replaceRoot: { newRoot: "$doc" } }, // replace the root of the document with the ticket
|
|
22
22
|
];
|
|
23
23
|
const aggregatedTicketKanbanStates = await new Parse.Query(types_1.Maintenance_Ticket_Kanban_State).aggregate(
|
|
24
24
|
// @ts-expect-error
|