Skip to content

Commit 7a0fd27

Browse files
authored
Merge pull request #18 from hugo-hsi-dev/opencode/issue5-20260312021330
Added Experience collection, updated config
2 parents e13ea9c + 5495d53 commit 7a0fd27

File tree

3 files changed

+435
-316
lines changed

3 files changed

+435
-316
lines changed

src/collections/Experience.ts

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
import type { CollectionConfig } from 'payload'
2+
3+
export const Experience: CollectionConfig = {
4+
slug: 'experience',
5+
admin: {
6+
useAsTitle: 'company',
7+
defaultColumns: ['company', 'position', 'startDate', 'current'],
8+
},
9+
fields: [
10+
{
11+
name: 'company',
12+
type: 'text',
13+
required: true,
14+
},
15+
{
16+
name: 'position',
17+
type: 'text',
18+
required: true,
19+
},
20+
{
21+
name: 'location',
22+
type: 'text',
23+
},
24+
{
25+
name: 'startDate',
26+
type: 'date',
27+
required: true,
28+
admin: {
29+
date: {
30+
pickerAppearance: 'monthOnly',
31+
},
32+
},
33+
},
34+
{
35+
name: 'endDate',
36+
type: 'date',
37+
admin: {
38+
date: {
39+
pickerAppearance: 'monthOnly',
40+
},
41+
condition: (data) => !data?.current,
42+
},
43+
},
44+
{
45+
name: 'current',
46+
type: 'checkbox',
47+
defaultValue: false,
48+
},
49+
{
50+
name: 'description',
51+
type: 'richText',
52+
},
53+
{
54+
name: 'logo',
55+
type: 'upload',
56+
relationTo: 'media',
57+
},
58+
{
59+
name: 'technologies',
60+
type: 'relationship',
61+
relationTo: 'technologies',
62+
hasMany: true,
63+
},
64+
],
65+
}

0 commit comments

Comments
 (0)