Ignore:
Timestamp:
02/07/21 16:25:56 (4 years ago)
Author:
Dimitar Slezenkovski <dslezenkovski@…>
Branches:
master
Children:
e0cdea2
Parents:
ac51326
Message:

Fix create new user bug.

Location:
Farmatiko/Controllers
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Farmatiko/Controllers/AdminController.cs

    rac51326 r0a694bb  
    4444        [HttpPost]
    4545        [Route("api/pharmacyhead/add")]
    46         public async Task<IActionResult> AddPharmacyHead([FromBody]PharmacyHead pharmacyHead)
     46        public async Task<IActionResult> AddPharmacyHead([FromBody]PharmacyHeadDto pharmacyHead)
    4747        {
    48             await _service.AddPharmacyHead(pharmacyHead);
    49             return Ok("Pharmacy added.");
     48            bool Success = await _service.AddPharmacyHead(pharmacyHead);
     49            if (Success)
     50                return Ok("Pharmacy added.");
     51            return BadRequest();
    5052        }
    5153
    52         [HttpDelete]
     54        [HttpPost]
    5355        [Route("api/pharmacyhead/delete/{Id}")]
    5456        public async Task<IActionResult> RemovePharmacyHead([FromRoute] int Id)
     
    5759            return Ok();
    5860        }
    59         [HttpDelete]
     61        [HttpPost]
    6062        [Route("api/pharmacyhead/requests/{Id}")]
    6163        public IActionResult RejectRequest([FromRoute] int Id)
  • Farmatiko/Controllers/PharmacyHeadController.cs

    rac51326 r0a694bb  
    4444            return Ok(Success);
    4545        }
    46         [HttpDelete]
     46       /* [HttpDelete]
    4747        [Route("api/pharmacyhead/delete/{Id}")]
    4848        public async Task<IActionResult> Remove([FromRoute] int Id)
     
    5050            bool Success = await _PHService.Remove(Id);
    5151            return Ok(Success);
    52         }
    53         [HttpPost]
     52        }*/
     53       /* [HttpPost]
    5454        [Route("api/pharmacyhead/requests/{Id}")]
    5555        public async Task<IActionResult> RemoveClaimingRequest([FromRoute] int Id)
     
    5757            bool Success = await _PHService.RemoveClaimingRequest(Id);
    5858            return Ok(Success);
    59         }
     59        }*/
    6060
    6161    }
Note: See TracChangeset for help on using the changeset viewer.