Skip to content

Commit 50187f2

Browse files
authored
Merge pull request #94 from boolean-uk/93-patch-users-photo
(#93) Patching 'photo' for users should now work.
2 parents 5bfc803 + 32f24b3 commit 50187f2

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

exercise.wwwapi/DTOs/UserPatchDTO.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@ public class UserPatchDTO
1717
public DateTime? StartDate { get; set; }
1818
public DateTime? EndDate { get; set; }
1919
public string? Bio { get; set; }
20+
public string? Photo { get; set; }
2021
}
2122
}

exercise.wwwapi/Endpoints/UserEndpoints.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ public static async Task<IResult> UpdateUser(IRepository<User> repository, int i
220220
if (userPatch.StartDate != null) user.StartDate = (DateTime)userPatch.StartDate;
221221
if (userPatch.EndDate != null) user.EndDate = (DateTime)userPatch.EndDate;
222222
if (userPatch.Bio != null) user.Bio = userPatch.Bio;
223+
if (userPatch.Photo != null) user.Photo = userPatch.Photo;
223224

224225
repository.Update(user);
225226
repository.Save();

0 commit comments

Comments
 (0)