Commit d7b7edcc authored by Romain Courteaud's avatar Romain Courteaud

[erp5_web_renderjs_ui] Create a function

This commit does not change the behaviour of the gadget.

The goal is only to make the next commit more readable.
parent 2eb01519
......@@ -120,12 +120,14 @@
})
.declareMethod('allDocs', function (options) {
var context = this;
// throw new Error('do not use all docs');
if (options.list_method_template === undefined) {
return wrapJioCall(this, 'allDocs', arguments);
}
function triggerAllDocs() {
var query = options.query,
i,
key,
......@@ -217,7 +219,7 @@
options.selection_domain = selection_domain;
return wrapJioCall(
this,
context,
'getAttachment',
[
// XXX Ugly hardcoded meaningless id...
......@@ -226,7 +228,10 @@
.expand(options),
{format: "json"}
]
)
);
}
return triggerAllDocs()
.push(function (catalog_json) {
var data = catalog_json._embedded.contents || [],
summary = catalog_json._embedded.sum || [],
......
......@@ -228,7 +228,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>970.5239.3705.62003</string> </value>
<value> <string>975.47596.63165.63232</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -246,7 +246,7 @@
</tuple>
<state>
<tuple>
<float>1536227971.17</float>
<float>1557912100.81</float>
<string>UTC</string>
</tuple>
</state>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment