🔧 refactor(api): исправляет интерфейсы и убирает ненужные приведения типов в API запросах
This commit is contained in:
@@ -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')
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user