Compare commits

...

10 Commits

Author SHA1 Message Date
Dominik Natter
f2e4d36d0f fix: deployment 2025-03-31 14:38:13 +02:00
Dominik Natter
e645b7eabb fix: deployment 2025-03-31 14:07:57 +02:00
Dominik Natter
dbd1e098c8 fix: deployment 2025-03-31 14:02:00 +02:00
Dominik Natter
7e3ed5b8b5 fix: deployment 2025-03-31 13:53:58 +02:00
Dominik Natter
9663317a4e fix: ignore build errors and trust hosts 2025-03-27 23:41:04 +01:00
Dominik Natter
385580f4ee add: prototype section 2025-03-27 23:19:47 +01:00
Dominik Natter
c8b4ad9c87 change: layout and make responsive 2025-03-27 23:14:48 +01:00
Dominik Natter
7efd0507bb change: user permissions 2025-03-27 22:03:46 +01:00
dominiknatter
65119a1241 Merge pull request 'add: authentication provider microsoft login' (#3) from microsoft-login into main
Reviewed-on: #3
2025-03-27 20:57:35 +00:00
Dominik Natter
d016740db8 add: authentication provider microsoft login 2025-03-27 21:57:08 +01:00
14 changed files with 224 additions and 94 deletions

View File

@@ -1,7 +1,7 @@
# To use this Dockerfile, you have to set `output: 'standalone'` in your next.config.mjs file.
# Dockerfile
# From https://github.com/vercel/next.js/blob/canary/examples/with-docker/Dockerfile
FROM node:22.12.0-alpine AS base
FROM node:18-alpine AS base
# Install dependencies only when needed
FROM base AS deps
@@ -48,7 +48,6 @@ ENV NODE_ENV production
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
# Remove this line if you do not have this folder
COPY --from=builder /app/public ./public
# Set the correct permission for prerender cache

View File

@@ -2,42 +2,9 @@ version: '3'
services:
payload:
image: node:18-alpine
image: payload
build:
context: .
dockerfile: Dockerfile
ports:
- '3000:3000'
volumes:
- .:/home/node/app
- node_modules:/home/node/app/node_modules
working_dir: /home/node/app/
command: sh -c "corepack enable && corepack prepare pnpm@latest --activate && pnpm install && pnpm dev"
depends_on:
- mongo
# - postgres
env_file:
- .env
# Ensure your DATABASE_URI uses 'mongo' as the hostname ie. mongodb://mongo/my-db-name
mongo:
image: mongo:latest
ports:
- '27017:27017'
command:
- --storageEngine=wiredTiger
volumes:
- data:/data/db
logging:
driver: none
# Uncomment the following to use postgres
# postgres:
# restart: always
# image: postgres:latest
# volumes:
# - pgdata:/var/lib/postgresql/data
# ports:
# - "5432:5432"
volumes:
data:
# pgdata:
node_modules:
- "3000:3000"

View File

@@ -3,6 +3,10 @@ import { withPayload } from '@payloadcms/next/withPayload'
/** @type {import('next').NextConfig} */
const nextConfig = {
// Your Next.js config here
typescript: {
ignoreBuildErrors: true,
},
output: 'standalone',
}
export default withPayload(nextConfig, { devBundleServerPackages: false })

View File

@@ -15,6 +15,7 @@
"start": "cross-env NODE_OPTIONS=--no-deprecation next start"
},
"dependencies": {
"@libsql/linux-arm64-musl": "^0.5.3",
"@payloadcms/db-sqlite": "latest",
"@payloadcms/next": "latest",
"@payloadcms/payload-cloud": "latest",
@@ -25,7 +26,9 @@
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"cross-env": "^7.0.3",
"csv-parser": "^3.2.0",
"graphql": "^16.8.1",
"libsql": "^0.5.3",
"lucide-react": "^0.484.0",
"next": "15.2.3",
"next-auth": "5.0.0-beta.25",
@@ -50,12 +53,12 @@
"typescript": "5.7.3"
},
"engines": {
"node": "^18.20.2 || >=20.9.0",
"pnpm": "^9"
"node": "^18.20.2 || >=20.9.0"
},
"pnpm": {
"onlyBuiltDependencies": [
"sharp"
]
}
},
"packageManager": "pnpm@10.7.0+sha512.6b865ad4b62a1d9842b61d674a393903b871d9244954f652b8842c2b553c72176b278f64c463e52d40fff8aba385c235c8c9ecf5cc7de4fd78b8bb6d49633ab6"
}

88
pnpm-lock.yaml generated
View File

@@ -8,6 +8,9 @@ importers:
.:
dependencies:
'@libsql/linux-arm64-musl':
specifier: ^0.5.3
version: 0.5.3
'@payloadcms/db-sqlite':
specifier: latest
version: 3.31.0(@types/react@19.0.12)(payload@3.31.0(graphql@16.10.0)(typescript@5.7.3))(react@19.0.0)
@@ -38,9 +41,15 @@ importers:
cross-env:
specifier: ^7.0.3
version: 7.0.3
csv-parser:
specifier: ^3.2.0
version: 3.2.0
graphql:
specifier: ^16.8.1
version: 16.10.0
libsql:
specifier: ^0.5.3
version: 0.5.3
lucide-react:
specifier: ^0.484.0
version: 0.484.0(react@19.0.0)
@@ -1218,11 +1227,21 @@ packages:
cpu: [arm64]
os: [darwin]
'@libsql/darwin-arm64@0.5.3':
resolution: {integrity: sha512-yAitxSuiaLT465uAvqXi1TzirXb+IOxa6sfC+uIuyCzAusLEhOFlEhutqenVx93lhPkJZJIiZkK1pIETIatnfg==}
cpu: [arm64]
os: [darwin]
'@libsql/darwin-x64@0.4.7':
resolution: {integrity: sha512-ezc7V75+eoyyH07BO9tIyJdqXXcRfZMbKcLCeF8+qWK5nP8wWuMcfOVywecsXGRbT99zc5eNra4NEx6z5PkSsA==}
cpu: [x64]
os: [darwin]
'@libsql/darwin-x64@0.5.3':
resolution: {integrity: sha512-ZBVinaZcCxVoTuCTdW7vY97XIc13RjCEFG16Ix+zemtJbGFCTos7EUhkGWuWIWG/1HXYpFbXu4d5d7p6p4TlQA==}
cpu: [x64]
os: [darwin]
'@libsql/hrana-client@0.7.0':
resolution: {integrity: sha512-OF8fFQSkbL7vJY9rfuegK1R7sPgQ6kFMkDamiEccNUvieQ+3urzfDFI616oPl8V7T9zRmnTkSjMOImYCAVRVuw==}
@@ -1238,26 +1257,51 @@ packages:
cpu: [arm64]
os: [linux]
'@libsql/linux-arm64-gnu@0.5.3':
resolution: {integrity: sha512-20qUC4O16qhGl1GPIBABgroytzLoML5hhVYrM5jaYhRHg2kFN9PytKV+M75vlyLiJk7CJwkRUxD4Xwo4OODRVg==}
cpu: [arm64]
os: [linux]
'@libsql/linux-arm64-musl@0.4.7':
resolution: {integrity: sha512-6kK9xAArVRlTCpWeqnNMCoXW1pe7WITI378n4NpvU5EJ0Ok3aNTIC2nRPRjhro90QcnmLL1jPcrVwO4WD1U0xw==}
cpu: [arm64]
os: [linux]
'@libsql/linux-arm64-musl@0.5.3':
resolution: {integrity: sha512-sv19UXkNo+J6lGSfv4tKjViqciU5MHdtcmaiyJ5BcsEouwDLp5gDbyr1iJHoQw+nWpsiNp1OO4x8JoqC6sZHkA==}
cpu: [arm64]
os: [linux]
'@libsql/linux-x64-gnu@0.4.7':
resolution: {integrity: sha512-CMnNRCmlWQqqzlTw6NeaZXzLWI8bydaXDke63JTUCvu8R+fj/ENsLrVBtPDlxQ0wGsYdXGlrUCH8Qi9gJep0yQ==}
cpu: [x64]
os: [linux]
'@libsql/linux-x64-gnu@0.5.3':
resolution: {integrity: sha512-fE/tkqGneXfMzQ5TY7ptoQXk8bRVGu6fVSmPiegCqmCcF457uO/7yqpQZyMav4viXAgmIkI15nyEo01ekaeBCg==}
cpu: [x64]
os: [linux]
'@libsql/linux-x64-musl@0.4.7':
resolution: {integrity: sha512-nI6tpS1t6WzGAt1Kx1n1HsvtBbZ+jHn0m7ogNNT6pQHZQj7AFFTIMeDQw/i/Nt5H38np1GVRNsFe99eSIMs9XA==}
cpu: [x64]
os: [linux]
'@libsql/linux-x64-musl@0.5.3':
resolution: {integrity: sha512-g/JIAmLJcsmhubfDtw5K4ipVx89Kr7V1cuoTFc/jDtBQNpfLVDOtNii3TTxvLg/yH+HRipE5Cus8hJdtysJXcw==}
cpu: [x64]
os: [linux]
'@libsql/win32-x64-msvc@0.4.7':
resolution: {integrity: sha512-7pJzOWzPm6oJUxml+PCDRzYQ4A1hTMHAciTAHfFK4fkbDZX33nWPVG7Y3vqdKtslcwAzwmrNDc6sXy2nwWnbiw==}
cpu: [x64]
os: [win32]
'@libsql/win32-x64-msvc@0.5.3':
resolution: {integrity: sha512-X7apIBRZNSSRh446NvUfq7AthUdH2OSLAAkzhOW48wCQxYheXU791WyOiroNl7s5HuIvJGAJUCR9hFLICYgWRg==}
cpu: [x64]
os: [win32]
'@monaco-editor/loader@1.5.0':
resolution: {integrity: sha512-hKoGSM+7aAc7eRTRjpqAZucPmoNOC4UUbknb/VNoTkEIkCPhqV8LfbsgM1webRM7S/z21eHEx9Fkwx8Z/C/+Xw==}
@@ -2279,6 +2323,11 @@ packages:
csstype@3.1.3:
resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==}
csv-parser@3.2.0:
resolution: {integrity: sha512-fgKbp+AJbn1h2dcAHKIdKNSSjfp43BZZykXsCjzALjKy80VXQNHPFJ6T9Afwdzoj24aMkq8GwDS7KGcDPpejrA==}
engines: {node: '>= 10'}
hasBin: true
damerau-levenshtein@1.0.8:
resolution: {integrity: sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA==}
@@ -3245,6 +3294,10 @@ packages:
resolution: {integrity: sha512-T9eIRCs6b0J1SHKYIvD8+KCJMcWZ900iZyxdnSCdqxN12Z1ijzT+jY5nrk72Jw4B0HGzms2NgpryArlJqvc3Lw==}
os: [darwin, linux, win32]
libsql@0.5.3:
resolution: {integrity: sha512-S3WR8WNCJV1VXraBFUKjDA6+8LcNDJMLm+83qohm1O3YM1iVqV2+/XN3SXOxpxVjuL4g/rLrjO5kzygkPefCFQ==}
os: [darwin, linux, win32]
lightningcss-darwin-arm64@1.29.2:
resolution: {integrity: sha512-cK/eMabSViKn/PG8U/a7aCorpeKLMlK0bQeNHmdb7qUnBkNPnL+oV5DjJUo0kqWsJUapZsM4jCfYItbqBDvlcA==}
engines: {node: '>= 12.0.0'}
@@ -5886,9 +5939,15 @@ snapshots:
'@libsql/darwin-arm64@0.4.7':
optional: true
'@libsql/darwin-arm64@0.5.3':
optional: true
'@libsql/darwin-x64@0.4.7':
optional: true
'@libsql/darwin-x64@0.5.3':
optional: true
'@libsql/hrana-client@0.7.0':
dependencies:
'@libsql/isomorphic-fetch': 0.3.1
@@ -5912,18 +5971,32 @@ snapshots:
'@libsql/linux-arm64-gnu@0.4.7':
optional: true
'@libsql/linux-arm64-gnu@0.5.3':
optional: true
'@libsql/linux-arm64-musl@0.4.7':
optional: true
'@libsql/linux-arm64-musl@0.5.3': {}
'@libsql/linux-x64-gnu@0.4.7':
optional: true
'@libsql/linux-x64-gnu@0.5.3':
optional: true
'@libsql/linux-x64-musl@0.4.7':
optional: true
'@libsql/linux-x64-musl@0.5.3':
optional: true
'@libsql/win32-x64-msvc@0.4.7':
optional: true
'@libsql/win32-x64-msvc@0.5.3':
optional: true
'@monaco-editor/loader@1.5.0':
dependencies:
state-local: 1.0.7
@@ -7204,6 +7277,8 @@ snapshots:
csstype@3.1.3: {}
csv-parser@3.2.0: {}
damerau-levenshtein@1.0.8: {}
data-uri-to-buffer@4.0.1: {}
@@ -8266,6 +8341,19 @@ snapshots:
'@libsql/linux-x64-musl': 0.4.7
'@libsql/win32-x64-msvc': 0.4.7
libsql@0.5.3:
dependencies:
'@neon-rs/load': 0.0.4
detect-libc: 2.0.2
optionalDependencies:
'@libsql/darwin-arm64': 0.5.3
'@libsql/darwin-x64': 0.5.3
'@libsql/linux-arm64-gnu': 0.5.3
'@libsql/linux-arm64-musl': 0.5.3
'@libsql/linux-x64-gnu': 0.5.3
'@libsql/linux-x64-musl': 0.5.3
'@libsql/win32-x64-msvc': 0.5.3
lightningcss-darwin-arm64@1.29.2:
optional: true

View File

@@ -20,17 +20,17 @@ export default function DiplomarbeitSearch() {
return (
<div className="w-full flex flex-col gap-16">
<div className="w-1/3 flex flex-col items-center mx-auto">
<h2 className="text-5xl w-auto pb-2">Diplomarbeitensuche</h2>
<div className="w-3/4 md:w-1/3 flex flex-col items-center mx-auto">
<h2 className="text-4xl md:text-5xl w-auto pb-2">Diplomarbeitensuche</h2>
<Input type="text" value={search} placeholder="Suche" onChange={(e) => setSearch(e.target.value)} className="w-full" />
</div>
<div className="flex flex-col justify-center mx-auto w-2/3">
<div className="flex flex-col justify-center mx-auto w-4/5 lg:w-2/3">
{results.map((result, index) => (
<Link key={index} href={"/diplomarbeit/" + result.id}>
<div key={index}>
<h2 className="text-3xl">{result.title}</h2>
<h3 className="text-xl">{result.year}</h3>
<h2 className="text-2xl md:text-3xl">{result.title}</h2>
<h3 className="text-lg md:text-xl">{result.year}</h3>
</div>
</Link>
))}

View File

@@ -10,10 +10,10 @@ export default function Footer() {
return (
<footer className="w-full h-20 bg-htl-red flex flex-row items-center p-2 gap-4 shadow-lg justify-between">
<div className="w-auto flex items-center flex-row gap-4">
<p className="text-xl text-white">Made with {"<3"} by</p>
<p className="text-sm md:text-xl text-white">Made with {"<3"} by</p>
<a href="https://natter.li" target="_blank">
<Image
className="h-6 w-auto"
className="h-4 md:h-6 w-auto"
src={natterLogoWhite}
alt={"Natter Logo"}
/>

View File

@@ -11,16 +11,16 @@ import { Button } from '@/components/ui/button'
export default async function Header(){
const session = await getPayloadSession();
return (
<header className="w-full h-20 flex flex-row items-center shadow-md justify-between pr-2">
<div className="w-auto flex h-full bg-htl-red items-center flex-row gap-4 px-2">
<header className="w-full h-20 flex flex-row items-center shadow-md justify-between">
<div className="w-full lg:w-auto flex h-full bg-htl-red items-center flex-row gap-4 px-2">
<Image
className="h-16 w-auto rounded"
src={HTLDLogo}
alt={"HTL Dornbirn Logo"}
/>
<p className="text-6xl text-white">Diplom- und Abschlussarbeiten</p>
<p className="text-2xl md:text-6xl text-white">Diplom- und Abschlussarbeiten</p>
</div>
<div className="w-auto">
<div className="hidden lg:block w-auto pr-2">
<Link href="/admin" className="text-sm/6 font-semibold text-gray-900">
Administration <span aria-hidden="true">&rarr;</span>
</Link>

View File

@@ -1,33 +1,33 @@
import { getPayload } from 'payload';
import config from '@payload-config';
import Link from "next/link"
import React from 'react'
import { getPayload } from "payload";
import config from "@payload-config";
import Link from "next/link";
import React from "react";
const team = [
{
name: 'Emma Dorsey',
role: 'Senior Developer',
name: "Emma Dorsey",
role: "Senior Developer",
imageUrl:
'https://images.unsplash.com/photo-1505840717430-882ce147ef2d?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=8&w=1024&h=1024&q=80',
bio: 'Praesentium iure error aliquam voluptas ut libero. Commodi placeat sit iure nulla officiis. Ut ex sit repellat tempora. Qui est accusamus exercitationem natus ut voluptas. Officiis velit eos ducimus.',
xUrl: '#',
linkedinUrl: '#',
"https://images.unsplash.com/photo-1505840717430-882ce147ef2d?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=8&w=1024&h=1024&q=80",
bio: "Praesentium iure error aliquam voluptas ut libero. Commodi placeat sit iure nulla officiis. Ut ex sit repellat tempora. Qui est accusamus exercitationem natus ut voluptas. Officiis velit eos ducimus.",
xUrl: "#",
linkedinUrl: "#",
},
// More people...
]
];
function Team({ people }) {
return (
<div className="bg-white py-24 md:py-32 lg:py-40">
<div className="mx-auto grid grid-cols-1 gap-20 px-6 lg:px-8 xl:grid-cols-3">
<div className="mx-auto max-w-2xl lg:mx-0">
<h2 className="text-4xl font-semibold tracking-tight text-pretty text-gray-900 sm:text-5xl">
<div className="py-24 md:py-32 lg:py-40">
<div className="mx-auto grid grid-cols-1 gap-5 xl:grid-cols-3">
<div className="max-w-2xl">
<h2 className="text-3xl font-semibold tracking-tight text-pretty text-gray-900 sm:text-5xl">
Projektteam
</h2>
</div>
<ul
role="list"
className="mx-auto grid max-w-2xl grid-cols-1 gap-x-6 gap-y-20 sm:grid-cols-2 lg:mx-0 lg:max-w-none lg:gap-x-8 xl:col-span-2"
className="mx-auto grid max-w-2xl grid-cols-1 gap-x-6 gap-y-20 sm:grid-cols-3 lg:mx-0 lg:gap-x-8 xl:col-span-2"
>
{people.map((person) => (
<li key={person.id}>
@@ -70,7 +70,7 @@ export default async function Page({
});
return (
<div className="w-2/3 mx-auto pt-4">
<div className="w-4/5 md:w-2/3 mx-auto pt-4 pb-16">
<Link href="/">
<span aria-hidden="true">&larr;</span> Zurück
</Link>
@@ -78,14 +78,71 @@ export default async function Page({
<h4 className="text-lg text-gray-600 pt-8">
Diplom- und Abschlussarbeiten ({result.year})
</h4>
<h1 className="text-4xl font-semibold">{result.title}</h1>
<h1 className="text-2xl md:text-4xl font-semibold">{result.title}</h1>
<Team people={result.authors} />
<h2 className="text-3xl">Zielsetzung</h2>
<p className="text-lg">{result.goal}</p>
<h2 className="text-3xl">Problemstellung</h2>
<p className="text-lg">{result.issue}</p>
<h2 className="text-3xl">Ergebnisse</h2>
<p className="text-lg">{result.result}</p>
<section className="py-4">
<h2 className="text-3xl font-semibold tracking-tight text-pretty text-gray-900 sm:text-5xl pb-4">
Zielsetzung
</h2>
<p className="text-lg text-justify">{result.goal}</p>
</section>
<section className="py-4">
<h2 className="text-3xl font-semibold tracking-tight text-pretty text-gray-900 sm:text-5xl pb-4">
Problemstellung
</h2>
<p className="text-lg text-justify">{result.issue}</p>
</section>
<section className="py-4">
<h2 className="text-3xl font-semibold tracking-tight text-pretty text-gray-900 sm:text-5xl pb-4">
Prototyp
</h2>
<div className="grid grid-cols-1 md:grid-cols-3 gap-4">
<img
alt={result.prototype.description}
src={result.prototype.image.url}
className="object-fill "
/>
<div className="col-span-2">
<p className="text-lg">{result.prototype.description}</p>
</div>
</div>
</section>
<section className="py-4">
<h2 className="text-3xl font-semibold tracking-tight text-pretty text-gray-900 sm:text-5xl pb-4">
Ergebnisse
</h2>
<p className="text-lg text-justify">{result.result}</p>
</section>
<section className="py-4">
<h2 className="text-3xl font-semibold tracking-tight text-pretty text-gray-900 sm:text-5xl pb-4">
Technologien
</h2>
<div className="grid grid-cols-1 md:grid-cols-3 gap-4">
{result.technologies.map((technology) => (
<div
key={technology.id}
className="w-full rounded-lg border border-gray-200 shadow-sm p-4 flex flex-col lg:flex-row gap-4"
>
<img
alt={technology.name + " Logo"}
src={technology.technology.url}
className="object-fill h-16"
/>
<div className="flex flex-col">
<h3 className="text-2xl">{technology.technology.name}</h3>
<p>{technology.description}</p>
</div>
</div>
))}
</div>
</section>
</div>
);
}

View File

@@ -15,6 +15,9 @@ export async function GET(req: NextRequest) {
const response = await payload.find({
collection: 'papers',
where: {
and: [
{ published: { equals: true } },
{
or: [
{ title: { contains: search } },
{ issue: { contains: search } },
@@ -24,6 +27,8 @@ export async function GET(req: NextRequest) {
{ 'authors.description': { contains: search } },
],
},
],
},
});
const docs = response.docs.map((doc) => ({ title: doc.title, year: doc.year, id: doc.id }));

View File

@@ -2,9 +2,16 @@
// auth.config.ts
import github from "next-auth/providers/github";
import { NextAuthConfig } from 'next-auth'
import MicrosoftEntraID from "next-auth/providers/microsoft-entra-id"
export const authConfig: NextAuthConfig = {
providers: [
github, // <-- Add your provider here
MicrosoftEntraID({
clientId: process.env.AUTH_MICROSOFT_ENTRA_ID_ID,
clientSecret: process.env.AUTH_MICROSOFT_ENTRA_ID_SECRET,
issuer: process.env.AUTH_MICROSOFT_ENTRA_ID_ISSUER,
}),
github,
],
trustHost: true,
};

View File

@@ -18,6 +18,7 @@ export const Media: CollectionConfig = {
create: ({ req: { user } }) => Boolean(user),
update: ({ req: { user } }) => Boolean(user && user.role === 'admin'),
delete: ({ req: { user } }) => Boolean(user && user.role === 'admin'),
read: () => true,
},
fields: [
{

View File

@@ -11,9 +11,10 @@ export const Papers: CollectionConfig = {
delete: ({ req: { user } }) => Boolean(user?.type === "admin"),
read: () => true,
update: async ({ req: { user, payload }, id }) => {
if (!user || !id) return false; // Explicitly handle missing ID
if (user?.type === "admin") return true;
if (!user || !id) return false; // Explicitly handle missing ID
const paper = await payload.findByID({
collection: "papers",
@@ -22,6 +23,7 @@ export const Papers: CollectionConfig = {
});
if (!paper) return false;
if(paper.published) return false;
return paper.authors.some((author: any) => author.name === user.name);
},
@@ -34,7 +36,7 @@ export const Papers: CollectionConfig = {
name: "published",
type: "checkbox",
defaultValue: false,
label: "Veröffentlicht",
label: "Veröffentlicht (Auf der Website sichtbar)",
access: {
update: ({ req: { user } }) => Boolean(user?.type === "admin"),
}

View File

@@ -11,12 +11,9 @@ export const Users: CollectionConfig = {
useAsTitle: 'email',
},
access: {
read: ({ req: { user } }) => Boolean(user),
create: ({ req: { user } }) => Boolean(user && user.type === 'admin'),
update: ({ req: { user } }) => {
if (!user) return false;
if(user.type === 'admin') return true;
return false;
},
update: ({ req: { user } }) => Boolean(user && user.type === 'admin'),
delete: ({ req: { user } }) => Boolean(user && user.type === 'admin'),
},
fields: [