Show the absence type in the employee list again
The three pending migrations have been applied, so absence_type exists and
the workaround that kept it out of this select can go. The status chip in
the list shows the specific kind again ("Bildungskarenz" rather than the
generic "Langzeitabwesenheit"), matching the detail page.
Verified against the database rather than by typecheck: employee_assignments
holds 809 rows for 809 employees with exactly one open interval each,
is_valid_svnr() agrees with the TypeScript implementation on all nine
documented cases, and the list, org-chart and detail queries all return rows.
This commit is contained in:
@@ -41,12 +41,7 @@ export default async function EmployeesPage({ searchParams }: EmployeesPageProps
|
|||||||
let query = supabase
|
let query = supabase
|
||||||
.from("employees")
|
.from("employees")
|
||||||
.select(
|
.select(
|
||||||
// absence_type is deliberately absent here until
|
"id, first_name, last_name, personnel_number, job_title, team_id, division_id, location_id, entry_date, employment_type, weekly_hours, status, absence_type",
|
||||||
// 20260726120000_absence_type.sql has been applied: PostgREST rejects
|
|
||||||
// the *whole* query for one unknown column, which turned the entire
|
|
||||||
// list blank rather than just dropping a chip label. The detail page
|
|
||||||
// selects "*" and shows the specific kind once the column exists.
|
|
||||||
"id, first_name, last_name, personnel_number, job_title, team_id, division_id, location_id, entry_date, employment_type, weekly_hours, status",
|
|
||||||
{ count: "exact" }
|
{ count: "exact" }
|
||||||
)
|
)
|
||||||
.order("last_name", { ascending: true })
|
.order("last_name", { ascending: true })
|
||||||
@@ -135,7 +130,7 @@ export default async function EmployeesPage({ searchParams }: EmployeesPageProps
|
|||||||
{e.employment_type} · <span className="tabular-nums">{e.weekly_hours}h</span>
|
{e.employment_type} · <span className="tabular-nums">{e.weekly_hours}h</span>
|
||||||
</td>
|
</td>
|
||||||
<td className="px-4 py-2.5">
|
<td className="px-4 py-2.5">
|
||||||
<StatusChip status={e.status} entryDate={e.entry_date} />
|
<StatusChip status={e.status} entryDate={e.entry_date} absenceType={e.absence_type} />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user