package models

// AddPublisher adds a publisher from a publisher struct
func AddPublisher(publisher Publisher) (newPublisher Publisher, err error) {
	_, err = x.Insert(&publisher)

	if err != nil {
		return Publisher{}, err
	}

	newPublisher, _, err = GetPublisherByID(publisher.ID)

	return newPublisher, err
}
