Skip to content

Commit 464e69e

Browse files
committed
Fix: Profile mapping 에러 수정
1 parent 35983da commit 464e69e

File tree

3 files changed

+40
-2
lines changed

3 files changed

+40
-2
lines changed

EveryPinApi.Presentation/Controllers/ProfileController.cs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,24 @@ public async Task<IActionResult> GetAllProfile()
3333
}
3434

3535
[HttpGet("{userId:guid}", Name = "GetProfileByUserId")]
36-
[Authorize(Roles = "NormalUser")]
36+
//[Authorize(Roles = "NormalUser")]
3737
public async Task<IActionResult> GetProfileByUserId(string userId)
3838
{
3939
var profile = await _service.ProfileService.GetProfileByUserId(userId, trackChanges: false);
4040
return Ok(profile);
4141
}
42+
43+
//[HttpPut("{userId:guid}")]
44+
//[Authorize(Roles = "NormalUser")]
45+
//public async Task<IActionResult> UpdateProfile(string userId, [FromBody] ProfileInputDto profileInputDto)
46+
//{
47+
// if (profileInputDto == null)
48+
// {
49+
// return BadRequest("ProfileInputDto가 null 입니다.");
50+
// }
51+
//
52+
// await _service.ProfileService.UpdateProfile(userId, profileInputDto, trackChanges: true);
53+
//
54+
// return NoContent(); // 204 No Content, when the update is successful but no data needs to be returned
55+
//}
4256
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace Shared.DataTransferObject.InputDto;
8+
9+
public class ProfileInputDto
10+
{
11+
public string? TagId;
12+
public string? Name;
13+
public string SelfIntroduction = null!;
14+
}

Shared/DataTransferObject/ProfileDto.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,14 @@
66

77
namespace Shared.DataTransferObject;
88

9-
public record ProfileDto(Guid Id, string? Name, string? SelfIntroduction, string? PhotoUrl, Guid UserId, DateTime? UpdatedDate, DateTime? CreatedDate);
9+
public record ProfileDto
10+
(
11+
int Id,
12+
Guid UserId,
13+
string? TagId,
14+
string? Name,
15+
string? SelfIntroduction,
16+
string? PhotoUrl,
17+
DateTime? UpdatedDate,
18+
DateTime? CreatedDate
19+
);

0 commit comments

Comments
 (0)