layout redesign for the modals
This commit is contained in:
@@ -11,12 +11,6 @@ import getPermission from "@/lib/api/getPermission";
|
||||
export default async function (link: ExtendedLink, userId: number) {
|
||||
if (!link) return { response: "Please choose a valid link.", status: 401 };
|
||||
|
||||
const collectionIsAccessible = await getPermission(userId, link.collectionId);
|
||||
|
||||
const memberHasAccess = collectionIsAccessible?.members.some(
|
||||
(e: UsersAndCollections) => e.userId === userId && e.canUpdate
|
||||
);
|
||||
|
||||
if (link.collection.ownerId) {
|
||||
const collectionIsAccessible = await getPermission(
|
||||
userId,
|
||||
|
||||
@@ -17,27 +17,22 @@ export default async function (userId: number) {
|
||||
|
||||
const tags = await prisma.tag.findMany({
|
||||
where: {
|
||||
ownerId: userId,
|
||||
owner: {
|
||||
OR: [
|
||||
{
|
||||
id: userId,
|
||||
},
|
||||
{
|
||||
collections: {
|
||||
some: {
|
||||
OR: [
|
||||
{ ownerId: userId }, // Tags owned by the user
|
||||
{
|
||||
links: {
|
||||
some: {
|
||||
collection: {
|
||||
members: {
|
||||
some: {
|
||||
user: {
|
||||
id: userId,
|
||||
},
|
||||
userId, // Tags from collections where the user is a member
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
orderBy: {
|
||||
links: {
|
||||
|
||||
Reference in New Issue
Block a user