// Delete removes the specified product from the system.
Delete removes the specified product from the system.
// Delete removes the specified product from the system .
func (p *Product) Delete(ctx context.Context, log *log.Logger, w http.ResponseWriter, r *http.Request, params map[string]string) error {
	ctx, span := trace.StartSpan(ctx, "handlers.Product.Delete")
	defer span.End()
	dbConn := p.MasterDB.Copy()
	defer dbConn.Close()
	err := product.Delete(ctx, dbConn, params["id"])
	if err = translate(err); err != nil {
		return errors.Wrapf(err, "Id: %s", params["id"])
	}
	web.Respond(ctx, log, w, nil, http.StatusNoContent)
	return nil
}
func ( p * Product ) Delete ( ctx context . Context , log * log . Logger , w http . ResponseWriter , r * http . Request , params map [ string ] string ) error { ctx , span := trace . StartSpan ( ctx , " " ) defer span . End ( ) dbConn := p . MasterDB . Copy ( ) defer dbConn . Close ( ) err := product . Delete ( ctx , dbConn , params [ " " ] ) if err = translate ( err ) ; err != nil { return errors . Wrapf ( err , " " , params [ " " ] ) } web . Respond ( ctx , log , w , nil , http . StatusNoContent ) return nil }
Delete removes the specified product from the system.
Delete removes the specified product from the system .