From 8202fb0dbc81c60ff3e8f27235b53c8823dbc8e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20Tikvi=C4=87?= Date: Wed, 21 Sep 2016 15:20:53 +0200 Subject: [PATCH] json payload simplyfied --- json_utility.go | 3 ++- tables_utility.go | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/json_utility.go b/json_utility.go index b95ab72..9e3f0c6 100644 --- a/json_utility.go +++ b/json_utility.go @@ -47,8 +47,9 @@ func NewJSONParams(lang LangMap, return jp } -func NewJSONPayload(r *http.Request, params JSONParams) JSONPayload { +func NewJSONPayload(r *http.Request, table string) JSONPayload { var obj JSONPayload + params := loadTable(table) obj.Method = strings.ToLower(r.Method + " " + r.URL.Path) obj.Params = make(map[string]string, 0) obj.Lang = make(map[string]map[string]string, 0) diff --git a/tables_utility.go b/tables_utility.go index 748b6fb..28bec4e 100644 --- a/tables_utility.go +++ b/tables_utility.go @@ -90,7 +90,7 @@ func InitTables(jsonbuf []byte) error { return nil } -func LoadTable(table string) JSONParams { +func loadTable(table string) JSONParams { return NewJSONParams(_tables.LoadTranslations(table), _tables.LoadFields(table), _tables.LoadIdField(table), -- 1.8.1.2