From 16e304c58a0ce3d7d1ffeb1e1308ae292188e4cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20Tikvi=C4=87?= Date: Mon, 13 Nov 2017 10:40:20 +0100 Subject: [PATCH] removed MakePayload: not as flexible as anticipated --- json_utility.go | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/json_utility.go b/json_utility.go index d177a53..184d8a2 100644 --- a/json_utility.go +++ b/json_utility.go @@ -93,22 +93,6 @@ func NewPayload(r *http.Request, table string) Payload { return pload } -// MakePayload returs a payload for provided table with populated Data field. -func MakePayload(r *http.Request, table string, data interface{}) Payload { - var pload Payload - - pload.Method = r.Method + " " + r.RequestURI - if table != "" { - pload.Params = make(map[string]string, 0) - pload.Lang = translations(table) - pload.Fields = fields(table) - pload.IdField = id(table) - pload.Correlations = correlations(table) - } - pload.Data = data - return pload -} - // DeliverPayload encodes payload to w. func DeliverPayload(w http.ResponseWriter, payload Payload) { json.NewEncoder(w).Encode(payload) -- 1.8.1.2