From be9b1fde78c232e3e754332ed58f4647a440ad99 Mon Sep 17 00:00:00 2001 From: Ubaldo Porcheddu Date: Sat, 28 Sep 2024 09:51:17 +0100 Subject: [PATCH] mysql fix --- api/main.go | 11 +++++++++-- sys/main.go | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/api/main.go b/api/main.go index 854c3ff..e0232ec 100644 --- a/api/main.go +++ b/api/main.go @@ -208,17 +208,24 @@ func Run(eja TypeApi, sessionSave bool) (result TypeApi, err error) { alert(&eja.Alert, db.Translate("ejaErrorEditId", eja.Owner)) } else { for key, val := range eja.Values { + var value interface{} fieldType := db.FieldTypeGet(eja.ModuleId, key) switch fieldType { case "password": if len(val) != 64 { - val = db.Sha256(val) + value = db.Sha256(val) } + case "boolean", "integer": + value = db.Number(val) + case "decimal": + value = db.Float(val) + default: + value = db.String(val) } if key == "ejaOwner" && db.Number(val) < 1 { eja.Values["ejaOwner"] = db.String(eja.Owner) } else { - db.Put(eja.Owner, eja.ModuleId, eja.Id, key, val) + db.Put(eja.Owner, eja.ModuleId, eja.Id, key, value) } } values, err := db.Get(eja.Owner, eja.ModuleId, eja.Id) diff --git a/sys/main.go b/sys/main.go index 500748e..946dff9 100644 --- a/sys/main.go +++ b/sys/main.go @@ -3,7 +3,7 @@ package sys const Name = "Tibula" -const Version = "17.9.27" +const Version = "17.9.28" var Options TypeConfig var Commands TypeCommand