@@ -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
0 commit comments