42 |
43 | ## Contributing
44 |
45 | - Fork the repo and create your branch from main
46 | - Submit the pull request
47 |
48 | ## License
49 |
50 | [MIT](/LICENSE)
51 |
--------------------------------------------------------------------------------
/apps/api/src/routes/dashboard/terms/_yearID/index.js:
--------------------------------------------------------------------------------
1 | import { URLSearchParams } from "url"
2 | import { getCurrentQuarter } from "@enis2/shared"
3 |
4 | export default async function (fastify) {
5 | fastify.get(
6 | "",
7 | {
8 | schema: {
9 | querystring: fastify.getSchema("domain"),
10 | headers: fastify.getSchema("token"),
11 | params: {
12 | type: "object",
13 | required: ["yearID"],
14 | properties: {
15 | yearID: { type: "string", minLength: 36, maxLength: 36 },
16 | },
17 | },
18 | response: {
19 | 200: {
20 | type: "array",
21 | items: {
22 | type: "object",
23 | properties: {
24 | Name: { type: "string" },
25 | Id: { type: "string" },
26 | isActual: { type: "boolean", default: false },
27 | },
28 | },
29 | },
30 | },
31 | tags: ["dashboard"],
32 | },
33 | },
34 | async (req, reply) => {
35 | const cookie = req.cookies
36 |
37 | const params = new URLSearchParams()
38 | params.append("schoolYearId", req.params.yearID)
39 |
40 | const periods = await fastify.api({
41 | method: "POST",
42 | url: `https://sms.${req.query.city}.nis.edu.kz/Ref/GetPeriods`,
43 | body: params,
44 | cookie,
45 | })
46 |
47 | const sortedPeriods = periods.data.sort((a, b) => {
48 | if (a.Name < b.Name) return -1;
49 | if (a.Name > b.Name) return 1;
50 | return 0;
51 | });
52 |
53 | sortedPeriods[getCurrentQuarter() - 1].isActual = true;
54 | await reply.send(sortedPeriods);
55 | }
56 | )
57 | }
58 |
--------------------------------------------------------------------------------
/apps/web-mars/src/components/base/loaders/LoadingOverlay.vue:
--------------------------------------------------------------------------------
1 |
2 |