func (h *Handler) CreateOffering(tkn string,
	offering *data.Offering) (*string, error) {
	logger := h.logger.Add(
		"method", "CreateOffering", "offering", offering)

	if !h.token.Check(tkn) {
		logger.Warn("access denied")
		return nil, ErrAccessDenied
	}

	err := h.prepareOffering(logger, offering)
	if err != nil {
		return nil, err
	}

	err = insert(logger, h.db.Querier, offering)
	if err != nil {
		return nil, err
	}

	return &offering.ID, nil
}
func (h *Handler) CreateOffering(tkn string,
	offering *data.Offering) (*string, error) {
	logger := h.logger.Add(
		"method", "CreateOffering", "offering", offering)

	if !h.token.Check(tkn) {
		logger.Warn("access denied")
		return nil, ErrAccessDenied
	}

	err := h.prepareOffering(logger, offering)
	if err != nil {
		return nil, err
	}

	err = insert(logger, h.db.Querier, offering)
	if err != nil {
		return nil, err
	}

	return &offering.ID, nil
}
func ( h * Handler ) CreateOffering ( tkn string , offering * data . Offering ) ( * string , error ) { logger := h . logger . Add ( " " , " " , " " , offering ) if ! h . token . Check ( tkn ) { logger . Warn ( " " ) return nil , ErrAccessDenied } err := h . prepareOffering ( logger , offering ) if err != nil { return nil , err } err = insert ( logger , h . db . Querier , offering ) if err != nil { return nil , err } return & offering . ID , nil }
// CreateOffering creates an offering.
CreateOffering creates an offering .