From e43b3b227b7d063910eb4e6de49c3469deaf775a Mon Sep 17 00:00:00 2001 From: Semyon Okulov Date: Wed, 13 Sep 2023 10:35:48 +0700 Subject: [PATCH] trying to fix cors --- frontend/src/components/UI/Mark/index.tsx | 2 +- frontend/src/utils/setDefaultMark.ts | 2 +- frontend/src/views/LoginForm.tsx | 5 +---- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/frontend/src/components/UI/Mark/index.tsx b/frontend/src/components/UI/Mark/index.tsx index 6f88ea79..ee696472 100644 --- a/frontend/src/components/UI/Mark/index.tsx +++ b/frontend/src/components/UI/Mark/index.tsx @@ -1,7 +1,7 @@ import { CSSProperties, FC } from 'react'; import { Footnote } from '@vkontakte/vkui'; import { EAbsenceTypes } from 'diary-shared'; -import { TMark } from '../../../../../shared'; +import {TMark} from "../../../types"; type Sizes = 'l' | 's'; diff --git a/frontend/src/utils/setDefaultMark.ts b/frontend/src/utils/setDefaultMark.ts index 357df017..33ecd64c 100644 --- a/frontend/src/utils/setDefaultMark.ts +++ b/frontend/src/utils/setDefaultMark.ts @@ -1,5 +1,5 @@ import { Task } from 'diary-shared'; -import { TextMark } from '../../../shared'; +import {TextMark} from "../types"; // TODO: можно с помощью неё фиксить ошибки с неправильными оценами const setDefaultMark = (task: Task): TextMark => { if (task.isRequired && !task.mark) { diff --git a/frontend/src/views/LoginForm.tsx b/frontend/src/views/LoginForm.tsx index 7d60ba5a..336f4ca9 100644 --- a/frontend/src/views/LoginForm.tsx +++ b/frontend/src/views/LoginForm.tsx @@ -83,15 +83,12 @@ const LoginForm: FC<{ id: string }> = ({ id }) => { setIsLoading(true); setPopout(); - const response = await fetch(`${import.meta.env.VITE_SERVER_URL}/login`, { + const response = await fetch(`${import.meta.env.VITE_SERVER_URL}/hello`, { method: 'POST', body: JSON.stringify({ login, password: passwordHashed, }), - headers: { - "Access-Control-Allow-Origin": "*" - } }); if (response.status === 401) { console.log('401');