From 347e27198492986c7e7bd37a17b2fbdabc3adf0e Mon Sep 17 00:00:00 2001 From: Tobie Morgan Hitchcock Date: Mon, 21 Sep 2020 09:20:22 +0100 Subject: [PATCH] Fix bug with RETURN DIFF in rpc methods --- web/rpc.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/web/rpc.go b/web/rpc.go index b2440135..9737977a 100644 --- a/web/rpc.go +++ b/web/rpc.go @@ -155,17 +155,17 @@ 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 []interface{}) (interface{}, error) { switch thing := thing.(type) { case *fibre.RPCNull: - return db.Execute(c, "UPDATE $class DIFF $data RETURN DIFF", map[string]interface{}{ + return db.Execute(c, "UPDATE $class DIFF $data RETURN AFTER", map[string]interface{}{ "class": sql.NewTable(class), "data": data, }) case []interface{}: - return db.Execute(c, "UPDATE $batch DIFF $data RETURN DIFF", map[string]interface{}{ + return db.Execute(c, "UPDATE $batch DIFF $data RETURN AFTER", map[string]interface{}{ "batch": sql.NewBatch(class, thing), "data": data, }) default: - return db.Execute(c, "UPDATE $thing DIFF $data RETURN DIFF", map[string]interface{}{ + return db.Execute(c, "UPDATE $thing DIFF $data RETURN AFTER", map[string]interface{}{ "thing": sql.NewThing(class, thing), "data": data, })