implemented test to prevent blank tags
This commit is contained in:
@@ -17,6 +17,7 @@
|
|||||||
let router = useTinyRouter();
|
let router = useTinyRouter();
|
||||||
|
|
||||||
async function addTag(){
|
async function addTag(){
|
||||||
|
if (!newTag) return;
|
||||||
if (!id) {
|
if (!id) {
|
||||||
// when creating elements, they don`t have an id, yet
|
// when creating elements, they don`t have an id, yet
|
||||||
tags.push(newTag);
|
tags.push(newTag);
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ public class TagModule extends BaseHandler implements TagService {
|
|||||||
var head = path.pop();
|
var head = path.pop();
|
||||||
long entityId = Long.parseLong(head);
|
long entityId = Long.parseLong(head);
|
||||||
var json = json(ex);
|
var json = json(ex);
|
||||||
if (!(json.has(TAG) && json.get(TAG) instanceof String tag)) throw missingFieldException(TAG);
|
if (!(json.has(TAG) && json.get(TAG) instanceof String tag && !tag.isBlank())) throw missingFieldException(TAG);
|
||||||
List<Long> userList = null;
|
List<Long> userList = null;
|
||||||
if (!json.has(USER_LIST)) throw missingFieldException(USER_LIST);
|
if (!json.has(USER_LIST)) throw missingFieldException(USER_LIST);
|
||||||
var ul = json.isNull(USER_LIST) ? null : json.get(USER_LIST);
|
var ul = json.isNull(USER_LIST) ? null : json.get(USER_LIST);
|
||||||
|
|||||||
Reference in New Issue
Block a user