Commit 4ac943c8 by Bogdan Andjelkovic

zavrsavanje zahteva bez komentarisanja obostrano

parent d21fa4de
......@@ -55,4 +55,33 @@ public class KomentarController {
}
return ("redirect:/lista-oglasa/"+oglasId);
}
@GetMapping("/profile/moji-zahtevi/sacuvaj-bez-komentara")
public String getSacuvajBezKomentara( @RequestParam("zahtevId") int zahtevId)
{
try {
zRepo.zahtevKorisnikKom( zahtevId);
Zahtev zahtev = zRepo.findZahtevById( zahtevId);
if( zahtev.getKorisnikKom() && zahtev.getVlasnikKom())
zRepo.deleteZahtev( zahtevId);
} catch (Exception e) {
throw new RuntimeException(e);
}
return ("redirect:/profile/moji-zahtevi");
}
@GetMapping("/oceni-bez-komentara")
public String getOceniBezKomentara( @RequestParam("zahtevId") int zahtevId,
@RequestParam("oglasId") int oglasId)
{
try {
zRepo.zahtevVlasnikKom( zahtevId);
Zahtev zahtev = zRepo.findZahtevById( zahtevId);
if( zahtev.getKorisnikKom() && zahtev.getVlasnikKom())
zRepo.deleteZahtev( zahtevId);
} catch (Exception e) {
throw new RuntimeException(e);
}
return ("redirect:/lista-oglasa/"+oglasId);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment