Merge pull request #17462 from gary-kim/fix/noid/check-if-tag-name-empty

Show error if tag name is empty
This commit is contained in:
Roeland Jago Douma 2019-10-08 19:25:02 +02:00 committed by GitHub
commit 480a3fc7af
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,5 +1,6 @@
/**
* @copyright Copyright (c) 2016 Joas Schilling <coding@schilljs.com>
* @copyright Copyright (c) 2019 Gary Kim <gary@garykim.dev>
*
* @license GNU AGPL version 3 or any later version
*
@ -83,6 +84,11 @@
userAssignable: level === 3
};
if (!data.name) {
OCP.Toast.error(t('systemtags_manager', 'Tag name is empty'));
return;
}
if (tagId) {
var model = this.collection.get(tagId);
model.save(data);