luci-base: uci.js: let internal RPC functions reject on errors

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
Jo-Philipp Wich 2020-04-10 22:52:52 +02:00
parent bd713f870a
commit 65d28a4ac9

View file

@ -31,44 +31,50 @@ return baseclass.extend(/** @lends LuCI.uci.prototype */ {
object: 'uci', object: 'uci',
method: 'get', method: 'get',
params: [ 'config' ], params: [ 'config' ],
expect: { values: { } } expect: { values: { } },
reject: true
}), }),
callOrder: rpc.declare({ callOrder: rpc.declare({
object: 'uci', object: 'uci',
method: 'order', method: 'order',
params: [ 'config', 'sections' ] params: [ 'config', 'sections' ],
reject: true
}), }),
callAdd: rpc.declare({ callAdd: rpc.declare({
object: 'uci', object: 'uci',
method: 'add', method: 'add',
params: [ 'config', 'type', 'name', 'values' ], params: [ 'config', 'type', 'name', 'values' ],
expect: { section: '' } expect: { section: '' },
reject: true
}), }),
callSet: rpc.declare({ callSet: rpc.declare({
object: 'uci', object: 'uci',
method: 'set', method: 'set',
params: [ 'config', 'section', 'values' ] params: [ 'config', 'section', 'values' ],
reject: true
}), }),
callDelete: rpc.declare({ callDelete: rpc.declare({
object: 'uci', object: 'uci',
method: 'delete', method: 'delete',
params: [ 'config', 'section', 'options' ] params: [ 'config', 'section', 'options' ],
reject: true
}), }),
callApply: rpc.declare({ callApply: rpc.declare({
object: 'uci', object: 'uci',
method: 'apply', method: 'apply',
params: [ 'timeout', 'rollback' ] params: [ 'timeout', 'rollback' ],
reject: true
}), }),
callConfirm: rpc.declare({ callConfirm: rpc.declare({
object: 'uci', object: 'uci',
method: 'confirm' method: 'confirm',
reject: true
}), }),