Commit 481f6d4d authored by Matija Obreza's avatar Matija Obreza

FIX: APIv0 upgrade

parent b48d32fb
......@@ -425,9 +425,9 @@ public class AccessionController extends ApiBaseController {
if (update.has("coll")) {
ObjectNode coll = (ObjectNode) update.get("coll");
upgradeToArray(update, coll, "collCode");
upgradeToArray(update, coll, "collName");
upgradeToArray(update, coll, "collInstAddress");
upgradeToArray(coll, "collCode");
upgradeToArray(coll, "collName");
upgradeToArray(coll, "collInstAddress");
}
ObjectNode taxonomy;
......@@ -444,10 +444,10 @@ public class AccessionController extends ApiBaseController {
upgradeTaxonomy(update, taxonomy, "subtAuthor");
}
private void upgradeToArray(ObjectNode update, ObjectNode coll, String fieldName) {
private void upgradeToArray(ObjectNode coll, String fieldName) {
JsonNode node = coll.get(fieldName);
if (node != null && !node.isArray()) {
ArrayNode collCode = update.putArray(fieldName);
ArrayNode collCode = coll.putArray(fieldName);
for (String x : node.asText().split(";")) {
if (StringUtils.isNotBlank(x)) {
collCode.add(x);
......
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