updated route + bug fixed

This commit is contained in:
daniel31x13
2023-11-19 16:22:27 -05:00
parent bd16136946
commit 0c6911aaf0
13 changed files with 98 additions and 103 deletions
@@ -10,14 +10,10 @@ export default async function deleteCollection(
if (!collectionId)
return { response: "Please choose a valid collection.", status: 401 };
const collectionIsAccessible = (await getPermission({
const collectionIsAccessible = await getPermission({
userId,
collectionId,
})) as
| (Collection & {
members: UsersAndCollections[];
})
| null;
});
const memberHasAccess = collectionIsAccessible?.members.some(
(e: UsersAndCollections) => e.userId === userId