mirror of
https://github.com/fergalmoran/snapp.git
synced 2025-12-22 09:41:45 +00:00
10 lines
347 B
TypeScript
10 lines
347 B
TypeScript
import { prisma } from '$lib/server/prisma';
|
|
import { SNAPP_NOT_FOUND } from '$lib/utils/constants';
|
|
|
|
export const get_one_snapp = async (shortcode: string) => {
|
|
const snapp = await prisma.snapp.findFirst({ where: { shortcode } });
|
|
if (!snapp) return [null, SNAPP_NOT_FOUND] as [null, string];
|
|
|
|
return [snapp, null] as [typeof snapp, null];
|
|
};
|