Creating front end page for plans
This commit is contained in:
		@ -33,6 +33,8 @@ type Widget struct {
 | 
			
		||||
	CreatedAt      time.Time `json:"-"`
 | 
			
		||||
	UpdatedAt      time.Time `json:"-"`
 | 
			
		||||
	Image          string    `json:"image"`
 | 
			
		||||
	IsRecurring    bool      `json:"is_recurring"`
 | 
			
		||||
	PlanID         string    `json:"plan_id"`
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Order is the type for all orders
 | 
			
		||||
@ -109,6 +111,7 @@ func (m *DBModel) GetWidget(id int) (Widget, error) {
 | 
			
		||||
 | 
			
		||||
	query := `SELECT id, name, description, inventory_level, price,
 | 
			
		||||
                     coalesce(image, ''),
 | 
			
		||||
                     is_recurring, plan_id,
 | 
			
		||||
                     created_at, updated_at
 | 
			
		||||
              FROM widgets WHERE id = ?;`
 | 
			
		||||
 | 
			
		||||
@ -120,6 +123,8 @@ func (m *DBModel) GetWidget(id int) (Widget, error) {
 | 
			
		||||
		&widget.InventoryLevel,
 | 
			
		||||
		&widget.Price,
 | 
			
		||||
		&widget.Image,
 | 
			
		||||
		&widget.IsRecurring,
 | 
			
		||||
		&widget.PlanID,
 | 
			
		||||
		&widget.CreatedAt,
 | 
			
		||||
		&widget.UpdatedAt,
 | 
			
		||||
	)
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user