API for rebuilding search index

This commit is contained in:
2025-12-06 16:32:32 +08:00
parent fbe8ac27bf
commit fd86d6c221
5 changed files with 59 additions and 6 deletions

View File

@@ -615,7 +615,15 @@ func GetPinnedResources() ([]model.ResourceView, error) {
return views, nil
}
func GetCharactersFromVndb(vnID string) ([]CharacterParams, error) {
func GetCharactersFromVndb(vnID string, uid uint) ([]CharacterParams, error) {
canUpload, err := checkUserCanUpload(uid)
if err != nil {
return nil, err
}
if !canUpload {
return nil, model.NewUnAuthorizedError("You have not permission to fetch characters from VNDB")
}
client := http.Client{}
jsonStr := fmt.Sprintf(`
{