mirror of
https://github.com/Damillora/Shioriko.git
synced 2024-11-24 13:27:31 +00:00
fix: upload tag error
This commit is contained in:
parent
63b19dcf0f
commit
16c9f998d5
@ -21,14 +21,14 @@ func GetTagAll() []models.TagListItem {
|
|||||||
return tags
|
return tags
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetTagAutocomplete() []models.TagAutocompleteListItem {
|
func GetTagAutocomplete() []string {
|
||||||
var tags []models.TagAutocompleteListItem
|
var tags []string
|
||||||
result := database.DB.Model(&database.Tag{}).
|
result := database.DB.Model(&database.Tag{}).
|
||||||
Joins("join tag_types on tag_types.id = tags.tag_type_id").
|
Joins("join tag_types on tag_types.id = tags.tag_type_id").
|
||||||
Select("concat(tag_types.name,':',tags.name) as name").
|
Select("concat(tag_types.name,':',tags.name) as name").
|
||||||
Find(&tags)
|
Find(&tags)
|
||||||
if result.Error != nil {
|
if result.Error != nil {
|
||||||
return []models.TagAutocompleteListItem{}
|
return []string{}
|
||||||
}
|
}
|
||||||
return tags
|
return tags
|
||||||
}
|
}
|
||||||
|
@ -94,7 +94,6 @@
|
|||||||
addKeys={[9, 32]}
|
addKeys={[9, 32]}
|
||||||
on:tags={onTagChange}
|
on:tags={onTagChange}
|
||||||
autoComplete={onAutocomplete}
|
autoComplete={onAutocomplete}
|
||||||
autoCompleteKey={"name"}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -112,7 +112,7 @@
|
|||||||
<div class="field">
|
<div class="field">
|
||||||
<label for="tags" class="label">Tags</label>
|
<label for="tags" class="label">Tags</label>
|
||||||
<div class="control" id="tags">
|
<div class="control" id="tags">
|
||||||
<Tags addKeys={[9, 32]} on:tags={onTagChange} autoComplete={onAutocomplete} autoCompleteKey={"name"} />
|
<Tags addKeys={[9, 32]} on:tags={onTagChange} autoComplete={onAutocomplete} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="control">
|
<div class="control">
|
||||||
|
Loading…
Reference in New Issue
Block a user