Skip to content

Commit

Permalink
KB-52 fix issue with Bad Request on schedule status, add noreferrer t…
Browse files Browse the repository at this point in the history
…o footer links
  • Loading branch information
niravzi committed Oct 11, 2024
1 parent 665ad91 commit f01d2b5
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 9 deletions.
17 changes: 13 additions & 4 deletions src/api/schedule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,28 @@ import Http from './index';
import { LecturerSchedule } from '../models/LecturerSchedule';
import { PagedResponse } from '../models/PagedResponse';
import { StudentSchedule } from '../models/StudentSchedule';
import qs from 'qs';

export const getScheduleByLecturer = (lecturerId: string): Promise<PagedResponse<LecturerSchedule>> => {
return Http.get(`/schedule/lecturer?lecturerId=${lecturerId}`);
const query = qs.stringify({ lecturerId });

return Http.get(`/schedule/lecturer?${query}`);
};

export const getScheduleByGroup = (groupId: string): Promise<PagedResponse<StudentSchedule>> => {
return Http.get(`/schedule/lessons?groupId=${groupId}`);
const query = qs.stringify({ groupId });

return Http.get(`/schedule/lessons?${query}`);
};

export const getExamsByGroup = (groupName: string): Promise<PagedResponse<Exam[]>> => {
return Http.get(`/exams/group?groupId=${groupName}`);
const query = qs.stringify({ groupName });

return Http.get(`/exams/group?${query}`);
};

export const getLastSyncDate = (groupId?: string): Promise<GroupSyncDate[]> => {
return Http.get(`/schedule/status?groupId=${groupId}`);
const query = qs.stringify({ groupId });

return Http.get(`/schedule/status?${query}`);
};
11 changes: 6 additions & 5 deletions src/components/Footer/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { FooterWrapper, FooterLogo, FooterSection } from './Footer.style';
import logo from '../../assets/footer-logo.svg';
import { FooterLogo, FooterSection, FooterWrapper } from './Footer.style';

import dayjs from 'dayjs';
import logo from '../../assets/footer-logo.svg';

export const Footer = () => {
return (
Expand All @@ -11,15 +12,15 @@ export const Footer = () => {
Національний технічний університет України"Київський політехнічний інститут імені Ігоря Сікорського" © 1998-{dayjs().year()}
</p>
<p>
Адреса: <a target="_blank" href="https://kpi.ua/location">Україна, 03056 м.Київ-56, проспект Перемоги, 37</a>
Адреса: <a target="_blank" rel="noreferrer" href="https://kpi.ua/location">Україна, 03056 м.Київ-56, проспект Перемоги, 37</a>
</p>
</FooterSection>
<FooterSection>
<p>
Розробник – <a target="_blank" href="https://kbis.kpi.ua">Конструкторське бюро інформаційних систем</a>
Розробник – <a target="_blank" rel="noreferrer" href="https://kbis.kpi.ua">Конструкторське бюро інформаційних систем</a>
</p>
<p>
Створено в рамках проекту "<a target="_blank" href="https://ecampus.kpi.ua">Електронний кампус КПІ</a>"
Створено в рамках проекту "<a target="_blank" rel="noreferrer" href="https://ecampus.kpi.ua">Електронний кампус КПІ</a>"
</p>
</FooterSection>
<FooterSection>
Expand Down
4 changes: 4 additions & 0 deletions src/queries/useLastSyncDate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ export const useLastSyncDate = (groupId?: string) => {
return useQuery({
queryKey: getQueryKey(groupId),
queryFn: async () => {
if (!groupId) {
return undefined;
}

const [groupSyncDate] = await getLastSyncDate(groupId);

return groupSyncDate;
Expand Down

0 comments on commit f01d2b5

Please sign in to comment.