🔧 refactor(api): исправляет интерфейсы и убирает ненужные приведения типов в API запросах

This commit is contained in:
Oscar
2026-06-08 18:00:44 +03:00
parent 031781a47e
commit ffde85242a
14 changed files with 58 additions and 123 deletions

View File

@@ -174,7 +174,6 @@
<script setup lang="ts">
import type { CreateProfileDto } from '@/api/api'
import type { UserProfile } from '@/composables/useAuth'
import type { District } from '@/composables/useUi'
import { useVuelidate } from '@vuelidate/core'
import { helpers, required } from '@vuelidate/validators'
@@ -224,7 +223,7 @@ watch(() => form.cityId, async (cityId) => {
}
loadingDistricts.value = true
try {
const res = await apiClient.api.citiesControllerFindDistricts(cityId) as unknown as District[]
const res = await apiClient.api.citiesControllerFindDistricts(cityId)
uiStore.setDistricts(cityId, res)
districts.value = res
}
@@ -270,7 +269,7 @@ async function finish() {
loading.value = true
try {
form.tagIds = selectedTags.value
const profile = await apiClient.api.profilesControllerCreate(form as unknown as CreateProfileDto) as unknown as UserProfile
const profile = await apiClient.api.profilesControllerCreate(form as unknown as CreateProfileDto)
authStore.addProfile(profile)
uiStore.addToast('Профиль создан', 'success')
router.replace('/feed')

View File

@@ -140,7 +140,7 @@ const dateOpen = ref(false)
onMounted(async () => {
loading.value = true
try {
const res = await apiClient.api.profilesControllerFindOne(profileId) as unknown as UserProfile
const res = await apiClient.api.profilesControllerFindOne(profileId)
profile.value = res
}
catch {