Refresh search options after changing search criteria

This commit is contained in:
The Magician 2024-06-12 18:53:32 +01:00
parent 80eb8696ca
commit 779adfd274
1 changed files with 5 additions and 3 deletions

View File

@ -19,9 +19,10 @@ var (
SetCode: "",
Foil: logic.Either,
Promo: logic.Either,
Language: "en",
Language: "",
}
searchOptions logic.SearchOptions
shouldRefreshSearch bool = true
searchOptions logic.SearchOptions
)
func getSearchCriteria() {
@ -29,10 +30,11 @@ func getSearchCriteria() {
searchCriteria.Foil = GetTriadicResponse("Foil (y/n/E):")
searchCriteria.Promo = GetTriadicResponse("Promo (y/n/E):")
searchCriteria.Language = GetStringResponse("Language:")
shouldRefreshSearch = true
}
func getSearchOptions(db *sql.DB) {
if searchOptions == nil {
if shouldRefreshSearch {
fmt.Println("LOADING")
options, err := logic.GetAllSearchOptions(db, searchCriteria)
logic.Check(err)