if (result.hasErrors()) {
return warehouseEdit(request, model, warehouseForm);
}
Warehouse warehouse = null;
if(StringUtils.isNotEmpty(warehouseForm.getId())){
warehouse = warehouseService.getWarehouseById(warehouseForm.getId());
}
try {
// CREATE OR UPDATE WAREHOUSE
Warehouse savedWarehouse = webBackofficeService.createOrUpdateWarehouse(requestData, warehouse, warehouseForm);
if (warehouse == null) {
addSuccessMessage(request, getSpecificMessage(ScopeWebMessage.WAREHOUSE, "create_success_message", locale));
} else {
addSuccessMessage(request, getSpecificMessage(ScopeWebMessage.WAREHOUSE, "update_success_message", locale));