This commit is contained in:
Iliyan Angelov
2025-10-13 01:49:06 +03:00
parent 76c857b4f5
commit 5ad9cbe3a6
97 changed files with 5752 additions and 2376 deletions

View File

@@ -18,7 +18,6 @@ export const useJobs = () => {
setError(null);
} catch (err) {
setError(err instanceof Error ? err.message : 'An error occurred');
console.error('Error fetching jobs:', err);
} finally {
setLoading(false);
}
@@ -39,21 +38,27 @@ export const useJob = (slug: string) => {
const [error, setError] = useState<string | null>(null);
useEffect(() => {
console.log('🔍 useJob hook called with slug:', slug);
if (!slug) {
console.log('❌ No slug provided, setting loading to false');
setLoading(false);
return;
}
const fetchJob = async () => {
try {
console.log('📡 Fetching job data for slug:', slug);
setLoading(true);
const data = await careerService.getJobBySlug(slug);
console.log('✅ Job data fetched successfully:', data);
setJob(data);
setError(null);
} catch (err) {
console.error('❌ Error fetching job data:', err);
setError(err instanceof Error ? err.message : 'An error occurred');
console.error('Error fetching job:', err);
} finally {
console.log('🔄 Setting loading to false');
setLoading(false);
}
};
@@ -81,7 +86,6 @@ export const useFeaturedJobs = () => {
setError(null);
} catch (err) {
setError(err instanceof Error ? err.message : 'An error occurred');
console.error('Error fetching featured jobs:', err);
} finally {
setLoading(false);
}