prod
This commit is contained in:
@@ -38,7 +38,7 @@ export async function getApplicationEligibility(
|
||||
};
|
||||
}
|
||||
|
||||
const citizenship = await prisma.citizenship.findUnique({ where: { userId } });
|
||||
const citizenship = await prisma.citizenship.findFirst({ where: { userId, revokedAt: null } });
|
||||
if (citizenship && !citizenship.revokedAt) {
|
||||
return {
|
||||
eligible: false,
|
||||
@@ -100,7 +100,7 @@ export async function getPendingApplicationsCount(): Promise<number> {
|
||||
}
|
||||
|
||||
export async function getActiveCitizenship(userId: string) {
|
||||
const citizenship = await prisma.citizenship.findUnique({ where: { userId } });
|
||||
if (!citizenship || citizenship.revokedAt) return null;
|
||||
return citizenship;
|
||||
}
|
||||
return prisma.citizenship.findFirst({
|
||||
where: { userId, revokedAt: null },
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user