Revision 58693
Added by Konstantina Galouni almost 4 years ago
modules/uoa-monitor-service/trunk/src/main/java/eu/dnetlib/uoamonitorservice/controllers/SectionController.java | ||
---|---|---|
79 | 79 |
// this section belongs in default profile and it is new or it is updated |
80 | 80 |
if(stakeholder.getDefaultId() == null) { |
81 | 81 |
if(sectionId == null) { |
82 |
onSaveDefaultSection(sectionFull, topicId, categoryId, subcategoryId, stakeholder);
|
|
82 |
onSaveDefaultSection(section, topicId, categoryId, subcategoryId, stakeholder); |
|
83 | 83 |
} |
84 | 84 |
else { |
85 |
onUpdateDefaultSection(sectionFull, stakeholder);
|
|
85 |
onUpdateDefaultSection(section, stakeholder); |
|
86 | 86 |
} |
87 | 87 |
} |
88 | 88 |
|
... | ... | |
93 | 93 |
sections = subCategory.getNumbers(); |
94 | 94 |
} |
95 | 95 |
|
96 |
int existing_index = sections.indexOf(sectionFull.getId());
|
|
96 |
int existing_index = sections.indexOf(section.getId()); |
|
97 | 97 |
if (existing_index == -1) { |
98 |
if(index != null) {
|
|
99 |
sections.add(Integer.parseInt(index), sectionFull.getId());
|
|
98 |
if(Integer.parseInt(index) != -1) {
|
|
99 |
sections.add(Integer.parseInt(index), section.getId()); |
|
100 | 100 |
} else { |
101 |
sections.add(sectionFull.getId());
|
|
101 |
sections.add(section.getId()); |
|
102 | 102 |
} |
103 | 103 |
subCategoryDAO.save(subCategory); |
104 | 104 |
log.debug("Section saved!"); |
Also available in: Unified diff
[Trunk | Monitor Service]: SectionController: [Bug fix] In method "saveSection()" (/{stakeholderId}/{topicId}/{categoryId}/{subcategoryId}/save/{index})
a. Pathvariable "index" is required - if index == -1, ignore it and add section in the end of the list.
b. Use id from saved section (Section<String> section) and not from RequestBody - if this is a new section, no id in "Section<Indicator> sectionFull" yet.