fix(indexers): toggle state (#1214)

* fix(indexers): toggle state

* fix(indexers): toggle state

---------

Co-authored-by: ze0s <43699394+zze0s@users.noreply.github.com>
This commit is contained in:
Fabricio Silva 2023-11-19 22:11:12 +00:00 committed by GitHub
parent cb036ac538
commit 8a8069408a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 2 deletions

View file

@ -41,7 +41,7 @@ type IndexerDefinition struct {
Identifier string `json:"identifier"`
Implementation string `json:"implementation"`
BaseURL string `json:"base_url,omitempty"`
Enabled bool `json:"enabled,omitempty"`
Enabled bool `json:"enabled"`
Description string `json:"description"`
Language string `json:"language"`
Privacy string `json:"privacy"`

View file

@ -702,6 +702,8 @@ func (s *service) ToggleEnabled(ctx context.Context, indexerID int, enabled bool
return err
}
indexer.Enabled = enabled
// update indexerInstances
if err := s.updateIndexer(*indexer); err != nil {
s.log.Error().Err(err).Msgf("failed to add indexer: %s", indexer.Name)

View file

@ -129,7 +129,6 @@ const ListItem = ({ indexer }: ListItemProps) => {
});
const onToggleMutation = (newState: boolean) => {
// backend is rejecting when ending the whole object
updateMutation.mutate(newState);
};