account, schduels, timezone profile and many imporant updates
This commit is contained in:
@@ -19,6 +19,7 @@ import Input from '../form/input/InputField';
|
||||
import Checkbox from '../form/input/Checkbox';
|
||||
import Button from '../ui/button/Button';
|
||||
import { useAuthStore } from '../../store/authStore';
|
||||
import { fetchCountries } from '../../utils/countries';
|
||||
|
||||
interface Plan {
|
||||
id: number;
|
||||
@@ -102,23 +103,8 @@ export default function SignUpFormUnified({
|
||||
const loadCountriesAndDetect = async () => {
|
||||
setCountriesLoading(true);
|
||||
try {
|
||||
const API_BASE_URL = import.meta.env.VITE_BACKEND_URL || 'https://api.igny8.com/api';
|
||||
const response = await fetch(`${API_BASE_URL}/v1/auth/countries/`);
|
||||
|
||||
if (response.ok) {
|
||||
const data = await response.json();
|
||||
setCountries(data.countries || []);
|
||||
} else {
|
||||
// Fallback countries if backend fails
|
||||
setCountries([
|
||||
{ code: 'US', name: 'United States' },
|
||||
{ code: 'GB', name: 'United Kingdom' },
|
||||
{ code: 'CA', name: 'Canada' },
|
||||
{ code: 'AU', name: 'Australia' },
|
||||
{ code: 'PK', name: 'Pakistan' },
|
||||
{ code: 'IN', name: 'India' },
|
||||
]);
|
||||
}
|
||||
const loadedCountries = await fetchCountries();
|
||||
setCountries(loadedCountries);
|
||||
|
||||
// Try to detect user's country for default selection
|
||||
// Note: This may fail due to CORS - that's expected and handled gracefully
|
||||
@@ -137,17 +123,6 @@ export default function SignUpFormUnified({
|
||||
// Silently fail - CORS or network error, keep default US
|
||||
// This is expected behavior and not a critical error
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('Failed to load countries:', err);
|
||||
// Fallback countries
|
||||
setCountries([
|
||||
{ code: 'US', name: 'United States' },
|
||||
{ code: 'GB', name: 'United Kingdom' },
|
||||
{ code: 'CA', name: 'Canada' },
|
||||
{ code: 'AU', name: 'Australia' },
|
||||
{ code: 'PK', name: 'Pakistan' },
|
||||
{ code: 'IN', name: 'India' },
|
||||
]);
|
||||
} finally {
|
||||
setCountriesLoading(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user