Пример #1
0
// LoadRecord populates action.Record
func (action *AccountShowAction) LoadRecord() {
	action.LoadQuery()
	if action.Err != nil {
		return
	}

	action.Err = db.Get(action.Ctx, action.Query, &action.Record)
}
Пример #2
0
// JSON is a method for actions.JSON
func (action *TransactionShowAction) JSON() {
	query := action.Query()

	if action.Err != nil {
		return
	}

	action.Err = db.Get(action.Ctx, query, &action.Record)

	if action.Err != nil {
		return
	}

	hal.Render(action.W, NewTransactionResource(action.Record))
}
Пример #3
0
// JSON is a method for actions.JSON
func (action *OperationShowAction) JSON() {
	query := action.Query()
	if action.Err != nil {
		return
	}

	action.Err = db.Get(action.Ctx, query, &action.Record)
	if action.Err != nil {
		return
	}

	r, err := NewOperationResource(action.Record)
	if err != nil {
		return
	}

	hal.Render(action.W, r)
}