fix: blank page loading filters (#107)

* fix(filters): load indexers separate

* feat: add ctx to filter related db methods
This commit is contained in:
Ludvig Lundgren 2022-02-03 21:58:41 +01:00 committed by GitHub
parent 10a2ab2c96
commit 26f558859a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 90 additions and 115 deletions

View file

@ -6,7 +6,7 @@ type ActionRepo interface {
Store(ctx context.Context, action Action) (*Action, error)
StoreFilterActions(ctx context.Context, actions []Action, filterID int64) ([]Action, error)
DeleteByFilterID(ctx context.Context, filterID int) error
FindByFilterID(filterID int) ([]Action, error)
FindByFilterID(ctx context.Context, filterID int) ([]Action, error)
List() ([]Action, error)
Delete(actionID int) error
ToggleEnabled(actionID int) error

View file

@ -11,9 +11,9 @@ https://autodl-community.github.io/autodl-irssi/configuration/filter/
*/
type FilterRepo interface {
FindByID(filterID int) (*Filter, error)
FindByID(ctx context.Context, filterID int) (*Filter, error)
FindByIndexerIdentifier(indexer string) ([]Filter, error)
ListFilters() ([]Filter, error)
ListFilters(ctx context.Context) ([]Filter, error)
Store(filter Filter) (*Filter, error)
Update(ctx context.Context, filter Filter) (*Filter, error)
ToggleEnabled(ctx context.Context, filterID int, enabled bool) error

View file

@ -11,7 +11,7 @@ type IndexerRepo interface {
Update(indexer Indexer) (*Indexer, error)
List() ([]Indexer, error)
Delete(ctx context.Context, id int) error
FindByFilterID(id int) ([]Indexer, error)
FindByFilterID(ctx context.Context, id int) ([]Indexer, error)
}
type Indexer struct {