+ font-bold pl-2 md:pl-12 text-transparent bg-clip-text"> Tech Tracker
- - | -Name | -Status | -Updated At | -||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
+ else {
+ return (
+
+
-
-
+
+
+ {employeeData.map((employee) => (
+
+ handleCheckboxChange(employee.id)}
+ />
+ |
+
+ {employee.name}
+ |
+
+ {employee.status}
+ |
+
+ {formatTime(employee.updatedAt)}
+ |
+ |
({ name: row.name, status: row.status, time: new Date(row.updatedAt), })); - return { data: formattedResults, meta: { @@ -121,25 +109,3 @@ export const legacyGetHistory = async (page: number, perPage: number): Promise
{ - try { - // Prepare and execute the queries for each technician - for (const technician of technicians) { - const { name, status } = technician; - const utcdate: Date = new Date(); - const query = sql` - UPDATE users - SET status = ${status}, updatedAt = ${utcdate} - WHERE name = ${name} - `; - - await db.execute(query); - } - - return { success: true }; - } catch (error) { - console.error("Error updating employee status by name:", error); - throw new Error("Failed to update status by name"); - } -};