lol you are the worst
This commit is contained in:
@@ -1,26 +0,0 @@
|
||||
'use server';
|
||||
|
||||
import db from '@/lib/db';
|
||||
|
||||
export async function getSetting(key: string): Promise<string | null> {
|
||||
try {
|
||||
const stmt = db.prepare('SELECT value FROM settings WHERE key = ?');
|
||||
const result = stmt.get(key) as { value: string } | undefined;
|
||||
return result?.value ?? null;
|
||||
} catch (error) {
|
||||
console.error(`Failed to get setting "${key}":`, error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
export async function setSetting(key: string, value: string): Promise<void> {
|
||||
try {
|
||||
const stmt = db.prepare(
|
||||
'INSERT INTO settings (key, value) VALUES (?, ?) ON CONFLICT(key) DO UPDATE SET value = excluded.value'
|
||||
);
|
||||
stmt.run(key, value);
|
||||
} catch (error) {
|
||||
console.error(`Failed to set setting "${key}":`, error);
|
||||
throw new Error(`Could not update setting for ${key}`);
|
||||
}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
|
||||
export interface User {
|
||||
id: number;
|
||||
email: string;
|
||||
password?: string; // Should be handled securely, not sent to client
|
||||
name: string;
|
||||
}
|
||||
Reference in New Issue
Block a user