Plsgit add -A

This commit is contained in:
Gabriel Brown 2024-07-20 23:35:11 -05:00
parent 330b2ce904
commit 0337ff1ad4

View File

@ -2,12 +2,6 @@ import "server-only";
import { db } from "~/server/db"; import { db } from "~/server/db";
import { sql } from "drizzle-orm"; import { sql } from "drizzle-orm";
// Function to Convert Date to UTC
const convertToUTC = (date: Date): Date => {
const utcDate = new Date(date.setHours(date.getUTCHours() + 24));
return utcDate;
}
// Function to Get Employees // Function to Get Employees
export const getEmployees = async () => { export const getEmployees = async () => {
return await db.query.users.findMany({ return await db.query.users.findMany({
@ -21,7 +15,6 @@ export const updateEmployeeStatus = async (employeeIds: string[], newStatus: str
// Convert array of ids to a format suitable for SQL query (comma-separated string) // Convert array of ids to a format suitable for SQL query (comma-separated string)
const idList = employeeIds.map(id => parseInt(id, 10)); const idList = employeeIds.map(id => parseInt(id, 10));
const updatedAt = new Date(); const updatedAt = new Date();
const utcdate: Date = convertToUTC(updatedAt);
// Prepare the query using drizzle-orm's template-like syntax for escaping variables // Prepare the query using drizzle-orm's template-like syntax for escaping variables
const query = sql` const query = sql`