Fix tags input

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2020-06-10 15:49:52 +02:00
parent 34d32112fa
commit 412206c2e7
No known key found for this signature in database
GPG key ID: A061B9DDE0CA0773

View file

@ -37,9 +37,10 @@ import { ITag } from "../../types/tag.model";
},
set(tagStrings) {
const tagEntities = tagStrings.map((tag: string | ITag) => {
if (!(tag instanceof String)) {
if (typeof tag !== "string") {
return tag;
}
// @ts-ignore
return { title: tag, slug: tag } as ITag;
});
this.$emit("input", tagEntities);