From bcb1d3174ce35989e2709b040bad2df0b0755b58 Mon Sep 17 00:00:00 2001 From: Tobie Morgan Hitchcock Date: Fri, 24 May 2019 10:11:41 +0100 Subject: [PATCH] Fix RPC Modify method --- web/rpc.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/web/rpc.go b/web/rpc.go index a58e52a5..b2440135 100644 --- a/web/rpc.go +++ b/web/rpc.go @@ -152,20 +152,20 @@ func (r *rpc) Change(c *fibre.Context, class string, thing interface{}, data map } } -func (r *rpc) Modify(c *fibre.Context, class string, thing interface{}, data map[string]interface{}) (interface{}, error) { +func (r *rpc) Modify(c *fibre.Context, class string, thing interface{}, data []interface{}) (interface{}, error) { switch thing := thing.(type) { case *fibre.RPCNull: - return db.Execute(c, "UPDATE $class DIFF $data RETURN AFTER", map[string]interface{}{ + return db.Execute(c, "UPDATE $class DIFF $data RETURN DIFF", map[string]interface{}{ "class": sql.NewTable(class), "data": data, }) case []interface{}: - return db.Execute(c, "UPDATE $batch DIFF $data RETURN AFTER", map[string]interface{}{ + return db.Execute(c, "UPDATE $batch DIFF $data RETURN DIFF", map[string]interface{}{ "batch": sql.NewBatch(class, thing), "data": data, }) default: - return db.Execute(c, "UPDATE $thing DIFF $data RETURN AFTER", map[string]interface{}{ + return db.Execute(c, "UPDATE $thing DIFF $data RETURN DIFF", map[string]interface{}{ "thing": sql.NewThing(class, thing), "data": data, })