- //
- //
- //
- //
- //Update
- //
- //
- //
- //);
-//};
diff --git a/src/server/db/schema.ts b/src/server/db/schema.ts
index f289d63..7fcad48 100644
--- a/src/server/db/schema.ts
+++ b/src/server/db/schema.ts
@@ -15,7 +15,7 @@ export const users = createTable(
id: bigint("id", {mode: "number"}).primaryKey().autoincrement(),
name: varchar("name", { length: 256 }).notNull(),
status: varchar("status", { length: 256 }).notNull(),
- updatedAt: timestamp("updated_at")
+ updatedAt: timestamp("updatedAt")
.default(sql`CURRENT_TIMESTAMP`)
.notNull(),
},
@@ -27,6 +27,6 @@ export const history = createTable(
id: bigint("id", {mode: "number"}).primaryKey().autoincrement(),
user_id: bigint("user_id", {mode: "number"}).references(() => users.id),
status: varchar("status", { length: 256 }).notNull(),
- updatedAt: timestamp("updated_at").notNull(),
+ updatedAt: timestamp("updatedAt").notNull(),
},
);
diff --git a/src/server/functions.ts b/src/server/functions.ts
index 89333d1..9ecb4e7 100644
--- a/src/server/functions.ts
+++ b/src/server/functions.ts
@@ -10,20 +10,21 @@ export const getEmployees = async () => {
};
// Function to Update Employee Status using Raw SQL
-export const updateEmployeeStatus = async (employeeIds: number[], newStatus: string) => {
+export const updateEmployeeStatus = async (employeeIds: string[], newStatus: string) => {
try {
// Convert array of ids to a format suitable for SQL query (comma-separated string)
- const idString = employeeIds.join(",");
+ const idList = employeeIds.map(id => parseInt(id, 10));
+ const updatedAt = new Date();
- // Prepare the raw SQL query with embedded variables
- const query = `
+ // Prepare the query using drizzle-orm's template-like syntax for escaping variables
+ const query = sql`
UPDATE users
- SET status = '${newStatus}', updatedAt = '${new Date().toISOString()}'
- WHERE id IN (${idString})
+ SET status = ${newStatus}, updatedAt = ${updatedAt}
+ WHERE id IN ${idList}
`;
- // Execute the raw SQL query using the execute method
- await db.execute(sql`${query}`);
+ // Execute the query
+ await db.execute(query);
return { success: true };
} catch (error) {
diff --git a/src/styles/globals.css b/src/styles/globals.css
index d8fb6d9..89dd5a6 100644
--- a/src/styles/globals.css
+++ b/src/styles/globals.css
@@ -67,3 +67,55 @@
@apply bg-background text-foreground;
}
}
+
+@media (min-width: 2000px) {
+ .ua-column {
+ min-width: 500px;
+ }
+ .s-column {
+ max-width: 800px
+ }
+}
+
+@media (max-width: 2000px) {
+ .techtable {
+ width: 90%;
+ font-size: 36;
+ }
+ .tabletitles {
+ font-size: 40;
+ }
+}
+
+@media (min-width: 1500px) {
+ .ua-column {
+ min-width: 400px;
+ }
+}
+
+@media (max-width: 1500px) {
+ .techtable {
+ font-size: 32px;
+ }
+ .tabletitles {
+ font-size:36px;
+ }
+}
+
+@media (min-width: 1000px) {
+ .ua-column {
+ min-width: 300px;
+ }
+}
+
+@media (max-width: 1000px) {
+ .title-text {
+ font-size: 32px;
+ }
+ .techtable {
+ font-size: 20px;
+ }
+ .tabletitles {
+ font-size:24px;
+ }
+}