Tao: clear permanent menu before each parse
This commit is contained in:
parent
a270bf12ff
commit
a37ef637ce
@ -55,6 +55,10 @@ func (restaurant *Restaurant) clearMenus() {
|
||||
}
|
||||
}
|
||||
|
||||
func (restaurant *Restaurant) clearPermanentMenus() {
|
||||
restaurant.permanent = []Meal{}
|
||||
}
|
||||
|
||||
func (restaurant *Restaurant) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(&RestaurantJSON{
|
||||
Id: restaurant.id,
|
||||
|
@ -24,6 +24,7 @@ func NewTaoRestaurant(url string, name string, id int) *TaoRestaurant {
|
||||
|
||||
func (restaurant *TaoRestaurant) Parse() {
|
||||
restaurant.clearMenus()
|
||||
restaurant.clearPermanentMenus()
|
||||
resp, err := http.Get(restaurant.url)
|
||||
if err != nil {
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user