change: layout and make responsive

This commit is contained in:
Dominik Natter
2025-03-27 23:14:48 +01:00
parent 7efd0507bb
commit c8b4ad9c87
7 changed files with 93 additions and 44 deletions

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"),
}