feat(admin): moved server build/update to full app
All checks were successful
Build and Push LST Docker Image / docker (push) Successful in 2m27s
All checks were successful
Build and Push LST Docker Image / docker (push) Successful in 2m27s
This commit is contained in:
17
backend/utils/updateAppStats.utils.ts
Normal file
17
backend/utils/updateAppStats.utils.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { db } from "../db/db.controller.js";
|
||||
import { appStats } from "../db/schema/stats.schema.js";
|
||||
|
||||
export const updateAppStats = async (
|
||||
data: Partial<typeof appStats.$inferInsert>,
|
||||
) => {
|
||||
await db
|
||||
.insert(appStats)
|
||||
.values({
|
||||
id: "primary",
|
||||
...data,
|
||||
})
|
||||
.onConflictDoUpdate({
|
||||
target: appStats.id,
|
||||
set: data,
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user