From 2b13e24f5d8aace36b730b81cbc33ca82752f3f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 16 Oct 2015 15:52:39 +0200 Subject: [PATCH] Fix params of concurrency dialog - ids is the first element of params - javascript doesn't have negative index - slice return an array --- src/rpc.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/rpc.js b/src/rpc.js index a5e0eab4ee..10988b4389 100644 --- a/src/rpc.js +++ b/src/rpc.js @@ -67,10 +67,10 @@ (args.method.endsWith('.write') || args.method.endsWith('.delete'))) { var model = args.method.split('.').slice(1, -1).join('.'); - Sao.common.concurrency.run( model, args.params[1][0], - args.params[-1]) + Sao.common.concurrency.run(model, args.params[0][0], + args.params.slice(-1)[0]) .then(function() { - delete args.params.slice(-1)._timestamp; + delete args.params.slice(-1)[0]._timestamp; Sao.rpc(args, session).then( dfd.resolve, dfd.reject); }, dfd.reject);