first commit
This commit is contained in:
19
lib/GetUserAccessCode.ts
Normal file
19
lib/GetUserAccessCode.ts
Normal file
@ -0,0 +1,19 @@
|
||||
"use server";
|
||||
|
||||
import { getAuth } from "@/auth/queries/getauth";
|
||||
import { daphnis } from "@/lib/prisma";
|
||||
|
||||
export async function getLachesisInUseCards() {
|
||||
const { user } = await getAuth();
|
||||
|
||||
if (!user || !user.accessCode) {
|
||||
throw new Error("User is not authenticated or accessCode is missing");
|
||||
}
|
||||
|
||||
const aimeUser = await daphnis.user.findFirst({
|
||||
where: {
|
||||
accessCode: user.accessCode,
|
||||
},
|
||||
});
|
||||
return aimeUser;
|
||||
}
|
Reference in New Issue
Block a user