Created
December 30, 2016 19:21
-
-
Save netodevel/46ae4c487ee99a37711722cc75efe93b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@PutMapping("/salarios/{salario_id}/editar") | |
public String save(Model model, @PathVariable("salario_id") Integer id, RedirectAttributes redirectAttributes) { | |
try { | |
if (id != null) { | |
SalarioMinimo salarioMinimo = (SalarioMinimo) salarioMinimoService.findOne(id); | |
salarioMinimoService.save(salarioMinimo); | |
redirectAttributes.addFlashAttribute("sucesso", "Salário Editado com sucesso."); | |
} | |
} catch (Exception e) { | |
e.printStackTrace(); | |
redirectAttributes.addFlashAttribute("error", "Problema ao editar salário."); | |
} | |
return "redirect:/salarios"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment