Creating front end page for plans

This commit is contained in:
2024-08-11 22:08:55 +02:00
parent a564ecb342
commit 16e5845559
9 changed files with 134 additions and 11 deletions

View File

@ -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,
)