diff --git a/src/fellowship-applications/fellowship-applications.request.dto.ts b/src/fellowship-applications/fellowship-applications.request.dto.ts index 0f04026..b91f83b 100644 --- a/src/fellowship-applications/fellowship-applications.request.dto.ts +++ b/src/fellowship-applications/fellowship-applications.request.dto.ts @@ -203,6 +203,15 @@ export class ProposalFieldsDto { @IsString() @MaxLength(255) location?: string; + + // Profile field: the applicant's name used on the certificate. Written + // through to `user.name` rather than stored on the application (see + // service), so it is never duplicated. Mirrors `location`. + @IsOptional() + @Transform(trim) + @IsString() + @MaxLength(255) + name?: string; } export class CreateFellowshipApplicationRequestDto extends ProposalFieldsDto { diff --git a/src/fellowship-applications/fellowship-applications.service.ts b/src/fellowship-applications/fellowship-applications.service.ts index 0885847..ee945c0 100644 --- a/src/fellowship-applications/fellowship-applications.service.ts +++ b/src/fellowship-applications/fellowship-applications.service.ts @@ -83,6 +83,10 @@ export class FellowshipApplicationsService { user.location = emptyToNull(dto.location); changed = true; } + if (dto.name !== undefined) { + user.name = emptyToNull(dto.name); + changed = true; + } if (dto.github !== undefined) { const handle = emptyToNull(dto.github); user.githubProfileUrl = handle