);
diff --git a/components/Modal/EditCollection.tsx b/components/Modal/EditCollection.tsx
index e69de29..2049622 100644
--- a/components/Modal/EditCollection.tsx
+++ b/components/Modal/EditCollection.tsx
@@ -0,0 +1,267 @@
+// Copyright (C) 2022-present Daniel31x13
+// This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 3.
+// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+// You should have received a copy of the GNU General Public License along with this program. If not, see .
+
+import React, { useState } from "react";
+import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
+import { faClose, faPlus } from "@fortawesome/free-solid-svg-icons";
+import useCollectionStore from "@/store/collections";
+import { ExtendedCollection, NewCollection } from "@/types/global";
+import { useSession } from "next-auth/react";
+
+type Props = {
+ toggleCollectionModal: Function;
+ collection: ExtendedCollection;
+};
+
+export default function EditCollection({
+ toggleCollectionModal,
+ collection,
+}: Props) {
+ const [activeCollection, setActiveCollection] =
+ useState(collection);
+
+ const [memberEmail, setMemberEmail] = useState("");
+
+ // const { addCollection } = useCollectionStore();
+
+ const session = useSession();
+
+ const submitCollection = async () => {
+ console.log(activeCollection);
+
+ // const response = await addCollection(newCollection as NewCollection);
+
+ // if (response) toggleCollectionModal();
+ };
+
+ const getUserByEmail = async (email: string) => {
+ const response = await fetch(`/api/routes/users?email=${email}`);
+
+ const data = await response.json();
+
+ return data.response;
+ };
+
+ return (
+
{linksByCollection.map((e, i) => {
diff --git a/prisma/migrations/20230424185742_/migration.sql b/prisma/migrations/20230427184353_init/migration.sql
similarity index 100%
rename from prisma/migrations/20230424185742_/migration.sql
rename to prisma/migrations/20230427184353_init/migration.sql
diff --git a/types/global.ts b/types/global.ts
index 21500a9..5da7f89 100644
--- a/types/global.ts
+++ b/types/global.ts
@@ -3,7 +3,7 @@
// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along with this program. If not, see .
-import { Collection, Link, Tag, UsersAndCollections } from "@prisma/client";
+import { Collection, Link, Tag } from "@prisma/client";
export interface ExtendedLink extends Link {
tags: Tag[];
@@ -34,5 +34,15 @@ export interface NewCollection {
}
export interface ExtendedCollection extends Collection {
- members: UsersAndCollections[];
+ members: {
+ collectionId: number;
+ userId: number;
+ canCreate: boolean;
+ canUpdate: boolean;
+ canDelete: boolean;
+ user: {
+ name: string;
+ email: string;
+ };
+ }[];
}