This will let Anyone to view this collection.
- {isPublic ? ( + {collection.isPublic ? (Public Link (Click to copy)
{account.name} diff --git a/lib/api/controllers/collections/updateCollection.ts b/lib/api/controllers/collections/updateCollection.ts index 1e6f436..1d51130 100644 --- a/lib/api/controllers/collections/updateCollection.ts +++ b/lib/api/controllers/collections/updateCollection.ts @@ -35,6 +35,7 @@ export default async function ( data: { name: collection.name, description: collection.description, + isPublic: collection.isPublic, members: { create: collection.members.map((e) => ({ user: { connect: { email: e.user.email } }, diff --git a/prisma/migrations/20230523040650_init/migration.sql b/prisma/migrations/20230528224940_init/migration.sql similarity index 98% rename from prisma/migrations/20230523040650_init/migration.sql rename to prisma/migrations/20230528224940_init/migration.sql index 351f017..f317c9c 100644 --- a/prisma/migrations/20230523040650_init/migration.sql +++ b/prisma/migrations/20230528224940_init/migration.sql @@ -16,6 +16,7 @@ CREATE TABLE "Collection" ( "id" SERIAL NOT NULL, "name" TEXT NOT NULL, "description" TEXT NOT NULL DEFAULT '', + "isPublic" BOOLEAN NOT NULL DEFAULT false, "ownerId" INTEGER NOT NULL, "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, diff --git a/prisma/schema.prisma b/prisma/schema.prisma index f80505e..10f14df 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -29,6 +29,7 @@ model Collection { id Int @id @default(autoincrement()) name String description String @default("") + isPublic Boolean @default(false) owner User @relation(fields: [ownerId], references: [id]) ownerId Int members UsersAndCollections[]