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.

File:
1 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)
Note: See TracChangeset for help on using the changeset viewer.