Skip to content
Snippets Groups Projects
Commit 269af03f authored by MikelLiza's avatar MikelLiza
Browse files

Fixups

parent f3ae33c4
No related branches found
No related tags found
No related merge requests found
...@@ -20,20 +20,20 @@ public class ProfileController : DefaultProfileController ...@@ -20,20 +20,20 @@ public class ProfileController : DefaultProfileController
_profileService = profileService; _profileService = profileService;
} }
[HttpPost("UpdateProfile")] [HttpPost("CreateOrUpdateProfile")]
[SwaggerResponse(204)] [SwaggerResponse(200, Type = typeof(ResponseEnvelope<ProfileDTO>))]
[SwaggerResponse(400, Type = typeof(ResponseEnvelope<ProfileDTO>))] [SwaggerResponse(400, Type = typeof(ResponseEnvelope<BadRequestObjectResult>))]
public async Task<ActionResult<ResponseEnvelope<ProfileDTO>>> UpdateProfile([FromBody] ProfileDTO profile) public async Task<ActionResult<ResponseEnvelope<ProfileDTO>>> CreateOrUpdateProfile([FromBody] ProfileDTO profile)
{ {
try try
{ {
await _profileService.CreateOrUpdateProfile(profile, UserId); var newProfile = await _profileService.CreateOrUpdateProfile(profile, UserId);
return Ok(profile); return Ok(newProfile);
} }
catch (Exception ex) catch (Exception ex)
{ {
return Unauthorized(ex.Message); return BadRequest(ex.Message);
} }
} }
......
...@@ -23,7 +23,6 @@ public class DefaultIntEntity : IDefaultEntity, IIntId, ITrackable ...@@ -23,7 +23,6 @@ public class DefaultIntEntity : IDefaultEntity, IIntId, ITrackable
public DateTimeOffset CreatedAt { get; set; } = DateTimeOffset.UtcNow; public DateTimeOffset CreatedAt { get; set; } = DateTimeOffset.UtcNow;
public DateTimeOffset? DeletedAt { get; set; } public DateTimeOffset? DeletedAt { get; set; }
[Key] [Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; set; } public int Id { get; set; }
public DateTimeOffset? UpdatedAt { get; set; } public DateTimeOffset? UpdatedAt { get; set; }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment