Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions src/collections/Links.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { isEvents } from '@/access/isEvents';
import type { CollectionConfig } from 'payload';

export const Links: CollectionConfig = {
slug: 'links',
admin: {
useAsTitle: 'title',
},
fields: [
{
name: 'title',
type: 'text',
required: true,
},
{
name: 'url',
type: 'text',
required: true,
},
{
name: 'description',
type: 'textarea',
required: false,
},
],
access: {
create: isEvents,
update: isEvents,
delete: isEvents,
read: () => true,
},
versions: {
drafts: true,
},
};
73 changes: 51 additions & 22 deletions src/payload-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export interface Config {
users: User;
media: Media;
events: Event;
links: Link;
sponsors: Sponsor;
'tech-stack': TechStack;
projects: Project;
Expand All @@ -84,6 +85,7 @@ export interface Config {
users: UsersSelect<false> | UsersSelect<true>;
media: MediaSelect<false> | MediaSelect<true>;
events: EventsSelect<false> | EventsSelect<true>;
links: LinksSelect<false> | LinksSelect<true>;
sponsors: SponsorsSelect<false> | SponsorsSelect<true>;
'tech-stack': TechStackSelect<false> | TechStackSelect<true>;
projects: ProjectsSelect<false> | ProjectsSelect<true>;
Expand Down Expand Up @@ -135,10 +137,6 @@ export interface UserAuthOperations {
/** This interface was referenced by `Config`'s JSON-Schema via the `definition` "users". */
export interface User {
id: string;
email: string;
emailVerified?: string | null;
name?: string | null;
image?: string | null;
/** Users can have one or many roles */
roles?:
| (
Expand All @@ -152,16 +150,23 @@ export interface User {
| 'exec'
)[]
| null;
accounts?:
updatedAt: string;
createdAt: string;
email: string;
resetPasswordToken?: string | null;
resetPasswordExpiration?: string | null;
salt?: string | null;
hash?: string | null;
loginAttempts?: number | null;
lockUntil?: string | null;
sessions?:
| {
id?: string | null;
provider: string;
providerAccountId: string;
type: string;
id: string;
createdAt?: string | null;
expiresAt: string;
}[]
| null;
updatedAt: string;
createdAt: string;
password?: string | null;
}
/** This interface was referenced by `Config`'s JSON-Schema via the `definition` "media". */
export interface Media {
Expand Down Expand Up @@ -216,6 +221,16 @@ export interface Event {
createdAt: string;
_status?: ('draft' | 'published') | null;
}
/** This interface was referenced by `Config`'s JSON-Schema via the `definition` "links". */
export interface Link {
id: string;
title: string;
url: string;
description?: string | null;
updatedAt: string;
createdAt: string;
_status?: ('draft' | 'published') | null;
}
/**
* Please upload a banner image to media before filling in sponsor.
*
Expand Down Expand Up @@ -325,6 +340,10 @@ export interface PayloadLockedDocument {
relationTo: 'events';
value: string | Event;
} | null)
| ({
relationTo: 'links';
value: string | Link;
} | null)
| ({
relationTo: 'sponsors';
value: string | Sponsor;
Expand Down Expand Up @@ -393,22 +412,23 @@ export interface PayloadMigration {
}
/** This interface was referenced by `Config`'s JSON-Schema via the `definition` "users_select". */
export interface UsersSelect<T extends boolean = true> {
id?: T;
email?: T;
emailVerified?: T;
name?: T;
image?: T;
roles?: T;
accounts?:
updatedAt?: T;
createdAt?: T;
email?: T;
resetPasswordToken?: T;
resetPasswordExpiration?: T;
salt?: T;
hash?: T;
loginAttempts?: T;
lockUntil?: T;
sessions?:
| T
| {
id?: T;
provider?: T;
providerAccountId?: T;
type?: T;
createdAt?: T;
expiresAt?: T;
};
updatedAt?: T;
createdAt?: T;
}
/** This interface was referenced by `Config`'s JSON-Schema via the `definition` "media_select". */
export interface MediaSelect<T extends boolean = true> {
Expand Down Expand Up @@ -450,6 +470,15 @@ export interface EventsSelect<T extends boolean = true> {
createdAt?: T;
_status?: T;
}
/** This interface was referenced by `Config`'s JSON-Schema via the `definition` "links_select". */
export interface LinksSelect<T extends boolean = true> {
title?: T;
url?: T;
description?: T;
updatedAt?: T;
createdAt?: T;
_status?: T;
}
/** This interface was referenced by `Config`'s JSON-Schema via the `definition` "sponsors_select". */
export interface SponsorsSelect<T extends boolean = true> {
'Company name'?: T;
Expand Down
2 changes: 2 additions & 0 deletions src/payload.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { CommitteeMembers } from './collections/CommitteeMembers';
import { Events } from './collections/Events';
import { Gallery } from './collections/Gallery';
import { KnownSpamMessages } from './collections/KnownSpamMessages';
import { Links } from './collections/Links';
import { Media } from './collections/Media';
import { Projects } from './collections/Projects';
import { Sponsors } from './collections/Sponsors';
Expand Down Expand Up @@ -91,6 +92,7 @@ export default buildConfig({
Users,
Media,
Events,
Links,
Sponsors,
Tech_Stack,
Projects,
Expand Down