[R4] Delete doctor in doctor controller
This commit is contained in:
parent
83ca208352
commit
1ca5714d85
@ -7,7 +7,9 @@ import org.springframework.data.domain.Page;
|
|||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
import org.springframework.data.web.PageableDefault;
|
import org.springframework.data.web.PageableDefault;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.PutMapping;
|
import org.springframework.web.bind.annotation.PutMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
@ -83,4 +85,18 @@ public class DoctorController {
|
|||||||
|
|
||||||
return ResponseEntity.ok(doctor);
|
return ResponseEntity.ok(doctor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete method to deactivate a existing doctor record by provided ID
|
||||||
|
*
|
||||||
|
* @param id Path variable that represents the doctor's unique identifier
|
||||||
|
*
|
||||||
|
* @return A response entity containing the deactivated doctor if successful
|
||||||
|
*/
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ResponseEntity<Object> deleteDoctor(@PathVariable Long id) {
|
||||||
|
Doctor doctor = doctorService.deactivateDoctor(id);
|
||||||
|
|
||||||
|
return ResponseEntity.ok(doctor);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user