Skip to content
This repository was archived by the owner on Apr 24, 2026. It is now read-only.

Commit 54327b9

Browse files
authored
Merge pull request #61 from renderghost/fix/issue-60-qualifications-bugs
Fix #60: Qualifications page issues
2 parents c48ba09 + a23f3c4 commit 54327b9

6 files changed

Lines changed: 200 additions & 179 deletions

File tree

lexicons/actor/biography/qualification.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"key": "tid",
99
"record": {
1010
"type": "object",
11-
"required": ["title", "institution", "createdAt"],
11+
"required": ["title", "type", "institution", "yearAwarded", "createdAt"],
1212
"properties": {
1313
"title": {
1414
"type": "string",
@@ -38,10 +38,11 @@
3838
"maxLength": 200,
3939
"description": "Field of study or specialization"
4040
},
41-
"dateAwarded": {
42-
"type": "string",
43-
"format": "datetime",
44-
"description": "Date the qualification was awarded"
41+
"yearAwarded": {
42+
"type": "integer",
43+
"minimum": 1900,
44+
"maximum": 2100,
45+
"description": "Year the qualification was awarded (YYYY format)"
4546
},
4647
"location": {
4748
"type": "ref",

src/app/api/about/qualifications/route.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,22 @@ export async function POST(request: NextRequest) {
1616
}
1717

1818
const body = await request.json();
19-
const { title, type, institution, field, dateAwarded, location } = body;
19+
const { title, type, institution, field, yearAwarded, location } = body;
2020

21-
if (!title || !institution) {
21+
if (!title || !type || !institution || !yearAwarded) {
2222
return NextResponse.json(
23-
{ error: 'Title and institution are required' },
23+
{ error: 'Title, type, institution, and year awarded are required' },
2424
{ status: 400 }
2525
);
2626
}
2727

2828
const repo = new ProfileRepository(agent);
2929
const rkey = await repo.createQualification({
3030
title,
31-
type: type || 'other',
31+
type,
3232
institution,
3333
field,
34-
dateAwarded,
34+
yearAwarded,
3535
location,
3636
});
3737

@@ -68,22 +68,22 @@ export async function PUT(request: NextRequest) {
6868
}
6969

7070
const body = await request.json();
71-
const { title, type, institution, field, dateAwarded, location } = body;
71+
const { title, type, institution, field, yearAwarded, location } = body;
7272

73-
if (!title || !institution) {
73+
if (!title || !type || !institution || !yearAwarded) {
7474
return NextResponse.json(
75-
{ error: 'Title and institution are required' },
75+
{ error: 'Title, type, institution, and year awarded are required' },
7676
{ status: 400 }
7777
);
7878
}
7979

8080
const repo = new ProfileRepository(agent);
8181
await repo.updateQualification(rkey, {
8282
title,
83-
type: type || 'other',
83+
type,
8484
institution,
8585
field,
86-
dateAwarded,
86+
yearAwarded,
8787
location,
8888
});
8989

src/app/dashboard/about/qualifications/page.tsx

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -127,17 +127,12 @@ export default async function QualificationsPage() {
127127
</div>
128128
</CardHeader>
129129
<CardContent className="pt-0">
130-
<div className="flex flex-wrap items-center gap-2">
131-
{qualification.field && (
132-
<span className="text-sm text-foreground">
133-
{qualification.field}
134-
</span>
135-
)}
136-
{qualification.dateAwarded && (
137-
<span className="text-sm text-foreground">
138-
{qualification.dateAwarded}
139-
</span>
130+
<div className="flex flex-wrap items-center gap-x-2 text-sm text-foreground">
131+
{qualification.field && <span>{qualification.field}</span>}
132+
{qualification.field && qualification.yearAwarded && (
133+
<span></span>
140134
)}
135+
{qualification.yearAwarded && <span>{qualification.yearAwarded}</span>}
141136
</div>
142137
</CardContent>
143138
</Card>

0 commit comments

Comments
 (0)