Skip to content

Commit

Permalink
Keep dot based notation for http request response path (#1152)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre-Gilles committed Apr 19, 2021
1 parent fd938df commit a483b2c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions front/src/routes/scene/edit-scene/actions/HttpRequest.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@ const METHOD_WITH_BODY = ['post', 'patch', 'put'];
const getAllPropertiesObject = (obj, path = '', results = []) => {
Object.keys(obj).forEach(key => {
const value = obj[key];
const keyFormatted = Number.isInteger(parseInt(key, 10)) ? `[${key}]` : key;
if (typeof value === 'object') {
getAllPropertiesObject(value, `${path}${keyFormatted}.`, results);
getAllPropertiesObject(value, `${path}${key}.`, results);
} else {
results.push(path + keyFormatted);
results.push(path + key);
}
});
return results;
Expand Down

0 comments on commit a483b2c

Please sign in to comment.