Commit 78ad5715 authored by Romain Courteaud's avatar Romain Courteaud

ERP5Storage: do not modify getAttachment result

portal_type attribute is not set anymore on getAttachment('person_module', 'view') json.
This remove duplicated code.
parent 7d2c0585
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
.push(function () { .push(function () {
var form = json._embedded._view, var form = json._embedded._view,
converted_json = { converted_json = {
portal_type: json.portal_type portal_type: json._links.type.name
}, },
form_data_json = {}, form_data_json = {},
field, field,
...@@ -204,7 +204,6 @@ ...@@ -204,7 +204,6 @@
hateoas = JSON.parse(response.target.responseText); hateoas = JSON.parse(response.target.responseText);
function pushResult(json) { function pushResult(json) {
json.portal_type = json._links.type.name;
return extractPropertyFromFormJSON(json) return extractPropertyFromFormJSON(json)
.push(function (json2) { .push(function (json2) {
return convertJSONToGet(json2); return convertJSONToGet(json2);
...@@ -322,7 +321,6 @@ ...@@ -322,7 +321,6 @@
{"_view": this._default_view_reference}) {"_view": this._default_view_reference})
.push(function (response) { .push(function (response) {
var result = JSON.parse(response.target.responseText); var result = JSON.parse(response.target.responseText);
result.portal_type = result._links.type.name;
// Remove all ERP5 hateoas links / convert them into jIO ID // Remove all ERP5 hateoas links / convert them into jIO ID
// XXX Change default action to an jio urn with attachment name inside // XXX Change default action to an jio urn with attachment name inside
......
...@@ -734,7 +734,6 @@ ...@@ -734,7 +734,6 @@
}) })
.then(function (result) { .then(function (result) {
var expected = JSON.parse(document_hateoas); var expected = JSON.parse(document_hateoas);
expected.portal_type = "Person";
deepEqual(JSON.parse(result.target.result), expected, deepEqual(JSON.parse(result.target.result), expected,
"Attachment correctly fetched"); "Attachment correctly fetched");
}) })
......
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