collection owner is now visible to other users

This commit is contained in:
Daniel
2023-07-17 23:31:26 -04:00
parent 46cca3cff3
commit 78f3d449bc
6 changed files with 100 additions and 28 deletions
+14 -6
View File
@@ -1,13 +1,21 @@
import { prisma } from "@/lib/api/db";
export default async function getUser(
lookupUsername: string,
isSelf: boolean,
username: string
) {
export default async function getUser({
params,
isSelf,
username,
}: {
params: {
lookupUsername?: string;
lookupId?: number;
};
isSelf: boolean;
username: string;
}) {
const user = await prisma.user.findUnique({
where: {
username: lookupUsername.toLowerCase(),
id: params.lookupId,
username: params.lookupUsername?.toLowerCase(),
},
});