Added types to databse/settings

This commit is contained in:
dominicbachmann 2022-04-06 20:31:51 +02:00
parent 008cfdba09
commit e9e92c6e9e

View File

@ -1,8 +1,9 @@
import { decrypt } from '$lib/crypto'; import { decrypt } from '$lib/crypto';
import { prisma } from './common'; import { prisma } from './common';
import type { Setting } from '@prisma/client';
export async function listSettings() { export async function listSettings(): Promise<Setting> {
let settings = await prisma.setting.findFirst({}); const settings = await prisma.setting.findFirst({});
if (settings.proxyPassword) settings.proxyPassword = decrypt(settings.proxyPassword); if (settings.proxyPassword) settings.proxyPassword = decrypt(settings.proxyPassword);
return settings; return settings;
} }