Add search filtering to stash UI

This commit is contained in:
The Magician 2024-06-11 16:28:17 +01:00
parent b7263a4bd6
commit cdf0a562fc
1 changed files with 8 additions and 2 deletions

View File

@ -15,13 +15,19 @@ var (
source string source string
cardCondition string cardCondition string
searchCriteria logic.SearchCriteria = logic.SearchCriteria{
SetCode: "",
Foil: logic.Either,
Promo: logic.Either,
Language: "en",
}
searchOptions logic.SearchOptions searchOptions logic.SearchOptions
) )
func getSearchOptions(db *sql.DB) { func getSearchOptions(db *sql.DB) {
if searchOptions == nil { if searchOptions == nil {
fmt.Println("LOADING") fmt.Println("LOADING")
options, err := logic.GetAllSearchOptions(db) options, err := logic.GetAllSearchOptions(db, searchCriteria)
logic.Check(err) logic.Check(err)
searchOptions = options searchOptions = options
fmt.Println("READY") fmt.Println("READY")
@ -61,7 +67,7 @@ func InsertSelectedCard(db *sql.DB) {
return return
} }
if storageBoxLabel == "" { if storageBoxLabel == "" || cardCondition == "" {
GetStorageOptions() GetStorageOptions()
} }