Remade code process

This commit is contained in:
A1pha 2024-12-06 11:23:19 +03:00
parent 2d88b38796
commit fe051bb26a

View File

@ -68,6 +68,9 @@ public class EmployeeCodeServiceImpl implements EmployeeService, CodeService {
code.setId(employeeId);
} else {
code = codeOptional.get();
if (code.getValue() != newCode.getValue()) {
throw new ResponseStatusException(HttpStatus.BAD_REQUEST);
}
code.setValue(newCode.getValue());
}
return codeRepository.save(code);