ommit on empty
This commit is contained in:
		| @@ -11,7 +11,6 @@ const endpoint = "https://diyhrt.market/api/listings" | ||||
|  | ||||
| func GetListings() ([]Listing, error) { | ||||
| 	apiKey := os.Getenv("API_KEY") | ||||
| 	fmt.Println(apiKey) | ||||
|  | ||||
| 	// why put api key in url parameter | ||||
| 	resp, err := http.NewRequest("GET", endpoint+"?api_token="+apiKey, nil) | ||||
|   | ||||
| @@ -2,40 +2,40 @@ package backend | ||||
|  | ||||
| type ActiveIngredient struct { | ||||
| 	Name        string `json:"name"` | ||||
| 	Ester       string `json:"ester"` | ||||
| 	DisplayName string `json:"display_name"` | ||||
| 	Ester       string `json:"ester,omitempty"` | ||||
| 	DisplayName string `json:"display_name,omitempty"` | ||||
| } | ||||
|  | ||||
| type Product struct { | ||||
| 	Id               int              `json:"id"` | ||||
| 	Id               int              `json:"id,omitempty"` | ||||
| 	Name             string           `json:"name"` | ||||
| 	Image            string           `json:"image"` | ||||
| 	Image            string           `json:"image,omitempty"` | ||||
| 	ActiveIngredient ActiveIngredient `json:"active_ingredient"` | ||||
| } | ||||
|  | ||||
| type Store struct { | ||||
| 	Id                 int    `json:"id"` | ||||
| 	Id                 int    `json:"id,omitempty"` | ||||
| 	Name               string `json:"name"` | ||||
| 	Url                string `json:"url"` | ||||
| 	Description        string `json:"description"` | ||||
| 	ShipsFromCountry   string `json:"ships_from_country"` | ||||
| 	ShipsToCountry     string `json:"ships_to_country"` | ||||
| 	ShipsFromCountry   string `json:"ships_from_country,omitempty"` | ||||
| 	ShipsToCountry     string `json:"ships_to_country,omitempty"` | ||||
| 	ServiceStatus      string `json:"service_status"` | ||||
| 	ServiceStatusNotes string `json:"service_status_notes"` | ||||
| 	PaymentMethods     string `json:"payment_methods"` | ||||
| 	CategoryName       string `json:"category_name"` | ||||
| 	ServiceStatusNotes string `json:"service_status_notes,omitempty"` | ||||
| 	PaymentMethods     string `json:"payment_methods,omitempty"` | ||||
| 	CategoryName       string `json:"category_name,omitempty"` | ||||
| } | ||||
|  | ||||
| type Listing struct { | ||||
| 	Id             int     `json:"id"` | ||||
| 	ProductName    string  `json:"product_name"` | ||||
| 	Id             int     `json:"id,omitempty"` | ||||
| 	ProductName    string  `json:"product_name,omitempty"` | ||||
| 	StoreName      string  `json:"store_name"` | ||||
| 	Price          string  `json:"price"` | ||||
| 	PriceCurrency  string  `json:"price_currency"` | ||||
| 	State          string  `json:"state"` | ||||
| 	Price          string  `json:"price,omitempty"` | ||||
| 	PriceCurrency  string  `json:"price_currency,omitempty"` | ||||
| 	State          string  `json:"state,omitempty"` | ||||
| 	InStock        bool    `json:"in_stock"` | ||||
| 	Url            string  `json:"url"` | ||||
| 	PricingPerUnit string  `json:"pricing_per_unit"` | ||||
| 	Url            string  `json:"url,omitempty"` | ||||
| 	PricingPerUnit string  `json:"pricing_per_unit,omitempty"` | ||||
| 	Product        Product `json:"product"` | ||||
| 	Store          Store   `json:"store"` | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user