Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change api to client #236

Merged
merged 2 commits into from
Sep 29, 2024
Merged

Change api to client #236

merged 2 commits into from
Sep 29, 2024

Conversation

BatuevIO
Copy link
Contributor

@BatuevIO BatuevIO commented Sep 5, 2024

Изменения

Изменение запросов к api на apiClient из api-uilib.

Детали реализации

  • Запросы теперь делаются через методы apiClient с соответствующими путями и параметрами.
  • Типы данных для переменных берутся из components в библиотеке api-uilib.

Check-List

  • Вы проверили свой код перед отправкой запроса?
  • Вы написали тесты к реализованным функциям?
  • Вы не забыли применить форматирование black и isort для Back-End или Prettier для Front-End?

src/api/auth/AuthEmailApi.ts Outdated Show resolved Hide resolved
src/api/auth/AuthEmailApi.ts Outdated Show resolved Hide resolved
src/models/LocalStorage.ts Outdated Show resolved Hide resolved
src/views/timetable/init/AsyncGroupsList.vue Show resolved Hide resolved
src/api/controllers/ServicesApi.ts Outdated Show resolved Hide resolved
src/components/IrdomAuthButton.vue Outdated Show resolved Hide resolved
src/router/auth.ts Outdated Show resolved Hide resolved
src/router/auth.ts Outdated Show resolved Hide resolved
src/router/auth.ts Outdated Show resolved Hide resolved
src/store/auth.ts Outdated Show resolved Hide resolved
src/views/admin/AdminView.vue Outdated Show resolved Hide resolved
src/views/admin/groups/AdminGroupsView.vue Outdated Show resolved Hide resolved
src/views/auth/OauthRegisterView.vue Outdated Show resolved Hide resolved
src/views/profile/achievement/AchievementsSlider.vue Outdated Show resolved Hide resolved
@BatuevIO
Copy link
Contributor Author

BatuevIO commented Sep 14, 2024

  • Починить конвертеры данных
  • Дочинить NavigationGuard в router/auth

src/api/controllers/auth/AuthApi.ts Show resolved Hide resolved
src/api/controllers/auth/AuthApi.ts Show resolved Hide resolved
src/api/controllers/auth/AuthApi.ts Show resolved Hide resolved
src/components/ForgotPassordForm.vue Show resolved Hide resolved
src/components/ForgotPassordForm.vue Outdated Show resolved Hide resolved
src/router/auth.ts Outdated Show resolved Hide resolved
src/router/auth.ts Outdated Show resolved Hide resolved
Comment on lines 81 to 93
if (error.response?.status === 401) {
const id_token = error.response.data.id_token;
if (error.status === 401) {
//Откуда тут тащить id)
const id_token = error.json()['id_token'];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А тут нет обычного тела ответа? Он же к ошибке должен был вернуть и обычное тело

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Запрос возвращает обычный response с телом, но я хз, как оттуда достать токен и при этом задать тип

src/views/profile/sessions/AsyncContent.vue Outdated Show resolved Hide resolved
src/views/timetable/init/AsyncGroupsList.vue Outdated Show resolved Hide resolved
@dyakovri
Copy link
Member

  • Перенести контроллеры в utils?

Да ну, не трогай

  • Перенести инициализацию клиента в main.ts?

Особого смысла не имеет

  • Починить конвертеры данных

А что с ними не так?

@BatuevIO
Copy link
Contributor Author

  • Починить конвертеры данных

А что с ними не так?

Я их в какой-то момент закомментил, чтобы не разбираться с типами. По идее, нужно их вернуть и правильно типизировать в соответствии с приходящими с клиента ответами

src/models/index.ts Outdated Show resolved Hide resolved
src/router/auth.ts Outdated Show resolved Hide resolved
src/router/auth.ts Outdated Show resolved Hide resolved
src/router/timetable.ts Outdated Show resolved Hide resolved
src/store/apps.ts Outdated Show resolved Hide resolved
@BatuevIO BatuevIO merged commit aafed68 into main Sep 29, 2024
2 checks passed
@BatuevIO BatuevIO deleted the change-api-to-client branch September 29, 2024 14:54
BatuevIO added a commit that referenced this pull request Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants