Commit 2272e695 authored by Matija Obreza's avatar Matija Obreza
Browse files

Crops redirect

parent 07ab1af0
......@@ -16,9 +16,6 @@
package org.genesys2.server.servlet.controller;
import java.util.HashMap;
import org.genesys2.server.model.genesys.Accession;
import org.genesys2.server.model.impl.Crop;
import org.genesys2.server.model.impl.CropTaxonomy;
import org.genesys2.server.service.CropService;
......
......@@ -92,14 +92,6 @@ public class ExplorerController extends BaseController {
model.addAttribute("filter", jsonFilter);
if (StringUtils.isNotBlank(shortName)) {
Crop crop = cropService.getCrop(shortName);
if (crop == null) {
throw new ResourceNotFoundException("No crop " + shortName);
}
return "redirect:/explore/c/" + crop.getShortName();
}
return "redirect:/explore";
}
......@@ -116,8 +108,9 @@ public class ExplorerController extends BaseController {
throw new ResourceNotFoundException("No crop " + shortName);
}
model.addAttribute("crop", crop);
return viewFiltered(model, page, jsonFilter);
model.addAttribute("filter", "{\"crop\":[\"" + crop.getShortName() + "\"]}");
model.addAttribute("page", page);
return "redirect:/explore";
}
/**
......
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