chore: sync infra docs and coverage
This commit is contained in:
@@ -14,7 +14,13 @@ const Jobs = () => {
|
||||
experienceLevel: ''
|
||||
});
|
||||
|
||||
const { data, isLoading, refetch } = useQuery(['jobs', filters], async () => {
|
||||
const {
|
||||
data,
|
||||
isLoading,
|
||||
isError,
|
||||
error,
|
||||
refetch
|
||||
} = useQuery(['jobs', filters], async () => {
|
||||
const params = new URLSearchParams();
|
||||
Object.entries(filters).forEach(([key, value]) => {
|
||||
if (value) params.append(key, value);
|
||||
@@ -55,7 +61,27 @@ const Jobs = () => {
|
||||
if (isLoading) {
|
||||
return (
|
||||
<div className="flex items-center justify-center h-64">
|
||||
<div className="animate-spin rounded-full h-32 w-32 border-b-2 border-primary-600"></div>
|
||||
<div
|
||||
role="status"
|
||||
aria-label="Loading jobs"
|
||||
className="animate-spin rounded-full h-32 w-32 border-b-2 border-primary-600"
|
||||
></div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
if (isError) {
|
||||
return (
|
||||
<div className="flex flex-col items-center justify-center h-64 text-center space-y-3">
|
||||
<h2 className="text-xl font-semibold text-gray-800">Unable to load jobs</h2>
|
||||
<p className="text-sm text-gray-500">{error?.message || 'Please try again later.'}</p>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => refetch()}
|
||||
className="btn btn-primary"
|
||||
>
|
||||
Retry
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -69,10 +95,6 @@ const Jobs = () => {
|
||||
Find your next career opportunity
|
||||
</p>
|
||||
</div>
|
||||
{/* Debug info */}
|
||||
<div className="text-xs text-gray-500 mb-2">
|
||||
Debug: User role = {user?.role || 'undefined'}
|
||||
</div>
|
||||
{(user?.role === 'employer' || user?.role === 'recruiter') && (
|
||||
<Link
|
||||
to="/jobs/create"
|
||||
|
||||
Reference in New Issue
Block a user