From e2ddd7e4e6f9b051f8efd0764cad63fccc665c45 Mon Sep 17 00:00:00 2001 From: mr Date: Mon, 2 Dec 2024 16:26:44 +0100 Subject: [PATCH] test --- entrypoint.go | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/entrypoint.go b/entrypoint.go index 362d617..363cc38 100644 --- a/entrypoint.go +++ b/entrypoint.go @@ -425,19 +425,15 @@ func (r *Request) StoreOne(object map[string]interface{}) (data LibData) { * @param c ...*tools.HTTPCaller * @return data LibData */ -func (r *Request) CopyOne(collection LibDataEnum, object map[string]interface{}, peerID string, groups []string, c ...*tools.HTTPCaller) (data LibData) { +func (r *Request) CopyOne(object map[string]interface{}) (data LibData) { defer func() { // recover the panic if r := recover(); r != nil { tools.UncatchedError = append(tools.UncatchedError, errors.New("Panic recovered in CopyOne : "+fmt.Sprintf("%v", r)+" - "+string(debug.Stack()))) data = LibData{Data: nil, Code: 500, Err: "Panic recovered in UpdateOne : " + fmt.Sprintf("%v", r) + " - " + string(debug.Stack())} } }() - var caller *tools.HTTPCaller // define the caller - if len(c) > 0 { - caller = c[0] - } - model := models.Model(collection.EnumIndex()) - d, code, err := model.GetAccessor(peerID, groups, caller).CopyOne(model.Deserialize(object, model)) + model := models.Model(r.collection.EnumIndex()) + d, code, err := model.GetAccessor(r.peerID, r.groups, r.caller).CopyOne(model.Deserialize(object, model)) if err != nil { data = LibData{Data: d, Code: code, Err: err.Error()} return