import { db } from "../db/db.controller.js";
import { appStats } from "../db/schema/stats.schema.js";

export const updateAppStats = async (
	data: Partial<typeof appStats.$inferInsert>,
) => {
	console.log(data);
	await db
		.insert(appStats)
		.values({
			id: "primary",
			...data,
		})
		.onConflictDoUpdate({
			target: appStats.id,
			set: data,
		});
};
