layout redesign for the modals

This commit is contained in:
Daniel
2023-05-16 20:38:28 +03:30
parent 54553b61b8
commit f43398d288
13 changed files with 330 additions and 258 deletions
-6
View File
@@ -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,
+9 -14
View File
@@ -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: {