interGroupList.js 685 B

12345678910111213141516171819202122
  1. /**
  2. * ПОЛУЧЕНИЕ СПИСКА МЕЖКЛАССНЫХ ГРУПП, ИМЕЮЩИХСЯ В КОЛЛЕКЦИИ CURRIC
  3. * Copyright © 2020, А.М.Гольдин. Modified BSD License
  4. */
  5. "use strict";
  6. // Возвращает несортированный массив групп типа
  7. // [
  8. // ["29Б", "Доп. главы математики", "ivanov"],
  9. // ...
  10. // ]
  11. module.exports = async () => {
  12. try {
  13. let grList = [];
  14. let res = await dbFind("curric", {type: "intergroup"});
  15. for (let doc of res)
  16. grList.push([doc.ingrName, doc.ingrTitle, doc.ingrTeach]);
  17. return JSON.stringify(grList);
  18. }
  19. catch(e) {return "[]";}
  20. };