update register page ui and api

This commit is contained in:
Samandar Turgunboyev
2026-02-24 11:28:06 +05:00
parent 0c9e0811ea
commit 8edd45d1ad
18 changed files with 14795 additions and 313 deletions

View File

@@ -9,12 +9,18 @@ import { ScrollView, StyleSheet, Text, TouchableOpacity } from 'react-native';
export default function CategorySelectScreen() {
const router = useRouter();
const { phone, stir, person_type } = useLocalSearchParams<{
const { phone, stir, person_type, director_full_name, referal, first_name, last_name } = useLocalSearchParams<{
phone: string;
stir: string;
person_type: 'band' | 'ytt';
referal: string;
director_full_name: string;
first_name: string;
last_name: string;
}>();
console.log(referal);
const [selected, setSelected] = React.useState<number | null>(null);
const { data } = useQuery({
@@ -28,6 +34,10 @@ export default function CategorySelectScreen() {
stir: string;
person_type: string;
activate_types: number[];
referal: string;
director_full_name: string;
first_name: string;
last_name: string;
}) => auth_api.register(body),
onSuccess: () => router.replace('/'),
});
@@ -52,12 +62,16 @@ export default function CategorySelectScreen() {
disabled={!selected || isPending}
style={[styles.bottom, (!selected || isPending) && { opacity: 0.5 }]}
onPress={() => {
if (phone && stir && person_type && selected) {
if (phone && stir && person_type && selected && referal && director_full_name) {
mutate({
activate_types: [selected],
person_type: person_type,
phone: `998${phone}`,
stir: stir,
referal: String(referal),
director_full_name: String(director_full_name),
first_name: String(first_name),
last_name: String(last_name),
});
}
}}