feat: add helper to detect system preference

This commit is contained in:
2026-03-03 21:47:07 +07:00
parent a6b2c77bd1
commit 02ad14d382
3 changed files with 74 additions and 0 deletions

View File

@ -0,0 +1,15 @@
import { AppError } from "../../../../helpers/error/instances/app";
import { prisma } from "../../../../utils/databases/prisma/connection";
export const findSystemPreferenceRepository = async (key: string) => {
try {
return await prisma.systemPreference.findUnique({
where: {
key,
deletedAt: null,
},
});
} catch (error) {
throw new AppError(500, "Failed to find system preference", error);
}
};