import { db } from '@/drizzle';
import { rolle } from '@/drizzle/schema';
import { eq, placeholder } from 'drizzle-orm';
import { cache } from 'react';
const rolleQuery = db
.select()
.from(rolle)
.where(eq(rolle.individualId, placeholder('individualId')))
.prepare();
export const getRoles = cache(async (individualId: string) => {
const roles = await rolleQuery.execute({ individualId });
if (roles.length === 0) {
return null;
}
return roles;
});
import { db } from '@/drizzle';
import { rolle } from '@/drizzle/schema';
import { eq, placeholder } from 'drizzle-orm';
import { cache } from 'react';
const rolleQuery = db
.select()
.from(rolle)
.where(eq(rolle.individualId, placeholder('individualId')))
.prepare();
export const getRoles = cache(async (individualId: string) => {
const roles = await rolleQuery.execute({ individualId });
if (roles.length === 0) {
return null;
}
return roles;
});