func GetMessage(w http.ResponseWriter, req *http.Request) {
	haddr, err := hash.NewFromHash(mux.Vars(req)["addr"])
	if err != nil {
		httputils.ErrorOut(w, http.StatusNotFound, accountNotFound)
		return
	}

	messageID := mux.Vars(req)["message"]

	ar := container.Instance.GetAccountRepo()
	header, err := ar.FetchMessageHeader(*haddr, messageID)
	if err != nil {
		httputils.ErrorOut(w, http.StatusNotFound, err.Error())
		return
	}
	catalog, err := ar.FetchMessageCatalog(*haddr, messageID)
	if err != nil {
		httputils.ErrorOut(w, http.StatusNotFound, err.Error())
		return
	}

	output := &api.Message{
		ID:      messageID,
		Header:  *header,
		Catalog: catalog,
	}

	_ = httputils.JSONOut(w, http.StatusOK, output)
}
// GetMessage will return a message header and catalog
GetMessage will return a message header and catalog
// GetMessage will return a message header and catalog
func GetMessage(w http.ResponseWriter, req *http.Request) {
	haddr, err := hash.NewFromHash(mux.Vars(req)["addr"])
	if err != nil {
		httputils.ErrorOut(w, http.StatusNotFound, accountNotFound)
		return
	}
	messageID := mux.Vars(req)["message"]
	ar := container.Instance.GetAccountRepo()
	header, err := ar.FetchMessageHeader(*haddr, messageID)
	if err != nil {
		httputils.ErrorOut(w, http.StatusNotFound, err.Error())
		return
	}
	catalog, err := ar.FetchMessageCatalog(*haddr, messageID)
	if err != nil {
		httputils.ErrorOut(w, http.StatusNotFound, err.Error())
		return
	}
	output := &api.Message{
		ID:      messageID,
		Header:  *header,
		Catalog: catalog,
	}
	_ = httputils.JSONOut(w, http.StatusOK, output)
}
func GetMessage ( w http . ResponseWriter , req * http . Request ) { haddr , err := hash . NewFromHash ( mux . Vars ( req ) [ " " ] ) if err != nil { httputils . ErrorOut ( w , http . StatusNotFound , accountNotFound ) return } messageID := mux . Vars ( req ) [ " " ] ar := container . Instance . GetAccountRepo ( ) header , err := ar . FetchMessageHeader ( * haddr , messageID ) if err != nil { httputils . ErrorOut ( w , http . StatusNotFound , err . Error ( ) ) return } catalog , err := ar . FetchMessageCatalog ( * haddr , messageID ) if err != nil { httputils . ErrorOut ( w , http . StatusNotFound , err . Error ( ) ) return } output := & api . Message { ID : messageID , Header : * header , Catalog : catalog , } _ = httputils . JSONOut ( w , http . StatusOK , output ) }
GetMessage will return a message header and catalog
GetMessage will return a message header and catalog