Remade code process
This commit is contained in:
parent
2d88b38796
commit
fe051bb26a
@ -68,6 +68,9 @@ public class EmployeeCodeServiceImpl implements EmployeeService, CodeService {
|
|||||||
code.setId(employeeId);
|
code.setId(employeeId);
|
||||||
} else {
|
} else {
|
||||||
code = codeOptional.get();
|
code = codeOptional.get();
|
||||||
|
if (code.getValue() != newCode.getValue()) {
|
||||||
|
throw new ResponseStatusException(HttpStatus.BAD_REQUEST);
|
||||||
|
}
|
||||||
code.setValue(newCode.getValue());
|
code.setValue(newCode.getValue());
|
||||||
}
|
}
|
||||||
return codeRepository.save(code);
|
return codeRepository.save(code);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user