I have no idea how but the date bug came back. Should be fixed

This commit is contained in:
2024-07-21 18:39:15 -05:00
parent 1259d19fde
commit 87c7169b3c
5 changed files with 62 additions and 9 deletions

View File

@@ -9,12 +9,16 @@ export const getEmployees = async () => {
});
};
const convertToUTC = (date: Date) => {
return new Date(date.setHours(date.getUTCHours())+ 5);
};
// Function to Update Employee Status using Raw SQL
export const updateEmployeeStatus = async (employeeIds: string[], newStatus: string) => {
try {
// Convert array of ids to a format suitable for SQL query (comma-separated string)
const idList = employeeIds.map(id => parseInt(id, 10));
const updatedAt = new Date();
const updatedAt = convertToUTC(new Date());
// Prepare the query using drizzle-orm's template-like syntax for escaping variables
const query = sql`