Fixed code error
This commit is contained in:
parent
0fe811d78c
commit
23322fdeb2
@ -62,14 +62,14 @@ namespace Marco.Pms.Services.Controllers
|
||||
return Ok(ApiResponse<object>.SuccessResponse(activityMaster, "Activity created successfully", 200));
|
||||
}
|
||||
|
||||
[HttpPost("edit{id}")]
|
||||
[HttpPost("edit/{id}")]
|
||||
public async Task<IActionResult> UpdateActivity(int id, [FromBody] CreateActivityMasterDto createActivity)
|
||||
{
|
||||
var tenantId = _userHelper.GetTenantId();
|
||||
var employee = await _userHelper.GetCurrentEmployeeAsync();
|
||||
ActivityMaster? activity = await _context.ActivityMasters.FirstOrDefaultAsync(x => x.Id == id);
|
||||
if (activity != null && createActivity.UnitOfMeasurement != null) {
|
||||
activity.ActivityName = activity.ActivityName;
|
||||
if (activity != null && createActivity.UnitOfMeasurement != null && createActivity.ActivityName != null) {
|
||||
activity.ActivityName = createActivity.ActivityName;
|
||||
activity.UnitOfMeasurement = createActivity.UnitOfMeasurement;
|
||||
activity.TenantId = tenantId;
|
||||
await _context.SaveChangesAsync();
|
||||
|
Loading…
x
Reference in New Issue
Block a user