mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 16:59:12 +00:00
fix: filter list toggle (#55)
This commit is contained in:
parent
e1ef47e09a
commit
48155e5f82
6 changed files with 73 additions and 2 deletions
|
@ -390,6 +390,25 @@ func (r *FilterRepo) Update(ctx context.Context, filter domain.Filter) (*domain.
|
|||
return &filter, nil
|
||||
}
|
||||
|
||||
func (r *FilterRepo) ToggleEnabled(ctx context.Context, filterID int, enabled bool) error {
|
||||
|
||||
var err error
|
||||
_, err = r.db.ExecContext(ctx, `
|
||||
UPDATE filter SET
|
||||
enabled = ?,
|
||||
updated_at = CURRENT_TIMESTAMP
|
||||
WHERE id = ?`,
|
||||
enabled,
|
||||
filterID,
|
||||
)
|
||||
if err != nil {
|
||||
log.Error().Stack().Err(err).Msg("error executing query")
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *FilterRepo) StoreIndexerConnections(ctx context.Context, filterID int, indexers []domain.Indexer) error {
|
||||
|
||||
tx, err := r.db.BeginTx(ctx, nil)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue