Skip to content
Snippets Groups Projects
Commit ec12dd58 authored by evilimkova's avatar evilimkova
Browse files

Delete certificate by id

parent 18948411
No related branches found
No related tags found
Loading
Pipeline #
......@@ -80,7 +80,8 @@ public class CertificateController {
* @param id Id of certificate to be deleted.
*/
@DeleteMapping("/delete")
public void delete(@RequestParam String id) {
public void delete(@RequestParam Long id) {
certificateFacade.deleteCertificate(id);
}
/**
......
......@@ -53,4 +53,9 @@ public class CertificateFacade {
//public Page<CertificateDto> findAll(Pageable pageable) {
//return certificateMapper.mapToPageDto(certificateService.findAll(pageable));
//}
@Transactional
public void deleteCertificate(Long certificateId) {
certificateService.delete(certificateId);
}
}
......@@ -40,6 +40,11 @@ public class CertificateService {
return certificateRepository.save(certificate);
}
@Transactional(readOnly = true)
public void delete(Long certificateId) {
certificateRepository.deleteById(certificateId);
}
@Transactional(readOnly = true)
public Page<Certificate> findAll(Pageable pageable) {
return certificateRepository.findAll(pageable);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment