Refresh search options after changing search criteria
This commit is contained in:
parent
80eb8696ca
commit
779adfd274
|
@ -19,9 +19,10 @@ var (
|
||||||
SetCode: "",
|
SetCode: "",
|
||||||
Foil: logic.Either,
|
Foil: logic.Either,
|
||||||
Promo: logic.Either,
|
Promo: logic.Either,
|
||||||
Language: "en",
|
Language: "",
|
||||||
}
|
}
|
||||||
searchOptions logic.SearchOptions
|
shouldRefreshSearch bool = true
|
||||||
|
searchOptions logic.SearchOptions
|
||||||
)
|
)
|
||||||
|
|
||||||
func getSearchCriteria() {
|
func getSearchCriteria() {
|
||||||
|
@ -29,10 +30,11 @@ func getSearchCriteria() {
|
||||||
searchCriteria.Foil = GetTriadicResponse("Foil (y/n/E):")
|
searchCriteria.Foil = GetTriadicResponse("Foil (y/n/E):")
|
||||||
searchCriteria.Promo = GetTriadicResponse("Promo (y/n/E):")
|
searchCriteria.Promo = GetTriadicResponse("Promo (y/n/E):")
|
||||||
searchCriteria.Language = GetStringResponse("Language:")
|
searchCriteria.Language = GetStringResponse("Language:")
|
||||||
|
shouldRefreshSearch = true
|
||||||
}
|
}
|
||||||
|
|
||||||
func getSearchOptions(db *sql.DB) {
|
func getSearchOptions(db *sql.DB) {
|
||||||
if searchOptions == nil {
|
if shouldRefreshSearch {
|
||||||
fmt.Println("LOADING")
|
fmt.Println("LOADING")
|
||||||
options, err := logic.GetAllSearchOptions(db, searchCriteria)
|
options, err := logic.GetAllSearchOptions(db, searchCriteria)
|
||||||
logic.Check(err)
|
logic.Check(err)
|
||||||
|
|
Loading…
Reference in New Issue