register update
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import { useTheme } from '@/components/ThemeContext';
|
||||
import { products_api } from '@/screens/home/lib/api';
|
||||
import { useMutation, useQuery } from '@tanstack/react-query';
|
||||
import { AxiosError } from 'axios';
|
||||
import { ChevronLeft, ChevronRight } from 'lucide-react-native';
|
||||
import React, { Dispatch, SetStateAction, useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import {
|
||||
ActivityIndicator,
|
||||
FlatList,
|
||||
@@ -12,6 +12,7 @@ import {
|
||||
TouchableOpacity,
|
||||
View,
|
||||
} from 'react-native';
|
||||
import { Toast } from 'toastify-react-native';
|
||||
|
||||
interface Category {
|
||||
id: number;
|
||||
@@ -44,6 +45,7 @@ export default function CategorySelect({ selectedCategories, setSelectedCategori
|
||||
const [currentCategories, setCurrentCategories] = useState<Category[]>([]);
|
||||
const [currentParentId, setCurrentParentId] = useState<number | null>(null);
|
||||
const [history, setHistory] = useState<HistoryItem[]>([]);
|
||||
const { t } = useTranslation()
|
||||
|
||||
// Root categories
|
||||
const { isLoading: rootLoading, error: rootError } = useQuery<CategoryResponse>({
|
||||
@@ -66,8 +68,8 @@ export default function CategorySelect({ selectedCategories, setSelectedCategori
|
||||
setCurrentCategories(childCategories);
|
||||
setCurrentParentId(id);
|
||||
},
|
||||
onError: (err: AxiosError) => {
|
||||
console.error('Child category loading error:', err);
|
||||
onError: () => {
|
||||
Toast.error(t("Xatolik yuz berdi"))
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user