mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-03-05 20:23:16 +08:00
Trim protocol keyword names before creation [SCI-9388] (#7017)
This commit is contained in:
parent
2691fe91c6
commit
e5384ee52a
1 changed files with 2 additions and 1 deletions
|
@ -135,10 +135,11 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
updateKeywords(keywords) {
|
updateKeywords(keywords) {
|
||||||
|
const uniqueKeywords = [...new Set(keywords.map((kw) => kw.trim()).filter((kw) => !!kw))];
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: 'PATCH',
|
type: 'PATCH',
|
||||||
url: this.protocol.attributes.urls.update_protocol_keywords_url,
|
url: this.protocol.attributes.urls.update_protocol_keywords_url,
|
||||||
data: { keywords },
|
data: { keywords: uniqueKeywords },
|
||||||
success: (result) => {
|
success: (result) => {
|
||||||
this.$emit('update', result.data.attributes);
|
this.$emit('update', result.data.attributes);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue