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
|
||||
}
|
||||
|
||||
func GetTagAutocomplete() []models.TagAutocompleteListItem {
|
||||
var tags []models.TagAutocompleteListItem
|
||||
func GetTagAutocomplete() []string {
|
||||
var tags []string
|
||||
result := database.DB.Model(&database.Tag{}).
|
||||
Joins("join tag_types on tag_types.id = tags.tag_type_id").
|
||||
Select("concat(tag_types.name,':',tags.name) as name").
|
||||
Find(&tags)
|
||||
if result.Error != nil {
|
||||
return []models.TagAutocompleteListItem{}
|
||||
return []string{}
|
||||
}
|
||||
return tags
|
||||
}
|
||||
|
@ -94,7 +94,6 @@
|
||||
addKeys={[9, 32]}
|
||||
on:tags={onTagChange}
|
||||
autoComplete={onAutocomplete}
|
||||
autoCompleteKey={"name"}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -112,7 +112,7 @@
|
||||
<div class="field">
|
||||
<label for="tags" class="label">Tags</label>
|
||||
<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 class="control">
|
||||
|
Loading…
Reference in New Issue
Block a user