File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -473,8 +473,9 @@ const accordionState = (key: keyof typeof form.value) => {
473473const canGenerateTags = computed (() => {
474474 const hasTitle = form .value .title && form .value .title .trim ().length > 0
475475 const hasDescription = form .value .description && form .value .description .trim ().length > 0
476+ const hasType = form .value .type ?.label && form .value .type .label .trim ().length > 0
476477 const hasLessThanMaxTags = form .value .tags .length < MAX_TAGS_NB
477- return hasTitle && hasDescription && hasLessThanMaxTags
478+ return hasTitle && hasDescription && hasType && hasLessThanMaxTags
478479})
479480
480481const setFiles = (files : Array <File >) => {
@@ -493,6 +494,10 @@ async function submit() {
493494}
494495
495496async function handleAutoCompleteTags(nbTags : number ) {
497+ if (! form .value .type ?.label ) {
498+ return
499+ }
500+
496501 try {
497502 isGeneratingTags .value = true
498503
@@ -504,7 +509,7 @@ async function handleAutoCompleteTags(nbTags: number) {
504509 body: {
505510 title: form .value .title ,
506511 description: form .value .description ,
507- type: form .value .type ? .label ,
512+ type: form .value .type .label . toLowerCase () ,
508513 nbTags: nbTags ,
509514 },
510515 })
You can’t perform that action at this time.
0 commit comments