MCPcopy
hub / github.com/YMFE/yapi / handleListClass

Method handleListClass

exts/yapi-plugin-export-data/controller.js:23–39  ·  view source on GitHub ↗
(pid, status)

Source from the content-addressed store, hash-verified

21 }
22
23 async handleListClass(pid, status) {
24 let result = await this.catModel.list(pid),
25 newResult = [];
26 for (let i = 0, item, list; i < result.length; i++) {
27 item = result[i].toObject();
28 list = await this.interModel.listByInterStatus(item._id, status);
29 list = list.sort((a, b) => {
30 return a.index - b.index;
31 });
32 if (list.length > 0) {
33 item.list = list;
34 newResult.push(item);
35 }
36 }
37
38 return newResult;
39 }
40
41 handleExistId(data) {
42 function delArrId(arr, fn) {

Callers 1

exportDataMethod · 0.95

Calls 2

listByInterStatusMethod · 0.80
listMethod · 0.45

Tested by

no test coverage detected