Skip to content

Commit

Permalink
switches object assign from broken one to d3plus-common
Browse files Browse the repository at this point in the history
  • Loading branch information
jhmullen committed Oct 29, 2019
1 parent 1a5e027 commit 0142dae
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 39 deletions.
8 changes: 4 additions & 4 deletions packages/cms/src/actions/profiles.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import axios from "axios";
import nestedObjectAssign from "../utils/nestedObjectAssign";
import {assign} from "d3plus-common";
import deepClone from "../utils/deepClone";

/** */
Expand Down Expand Up @@ -233,7 +233,7 @@ export function fetchVariables(config, useCache) {
}
// Once pruned, we can POST the variables to the materializer endpoint
axios.post(`${getStore().env.CANON_API}/api/materializers/${currentPid}?locale=${thisLocale}${paramString}`, {variables: variables[thisLocale]}).then(mat => {
variables[thisLocale] = nestedObjectAssign({}, variables[thisLocale], mat.data);
variables[thisLocale] = assign({}, variables[thisLocale], mat.data);
dispatch({type: "VARIABLES_SET", data: {id: currentPid, diffCounter, variables}});
});
}
Expand All @@ -257,7 +257,7 @@ export function fetchVariables(config, useCache) {
paramString += `&${k}=${query[k]}`;
});
axios.get(`${getStore().env.CANON_API}/api/generators/${currentPid}?locale=${thisLocale}${paramString}`).then(gen => {
variables[thisLocale] = nestedObjectAssign({}, variables[thisLocale], gen.data);
variables[thisLocale] = assign({}, variables[thisLocale], gen.data);
let gensLoaded = Object.keys(variables[thisLocale]._genStatus).filter(d => gids.includes(Number(d))).length;
const gensTotal = gids.length;
const genLang = thisLocale;
Expand All @@ -276,7 +276,7 @@ export function fetchVariables(config, useCache) {
delete variables[thisLocale]._matStatus[mid];
});
axios.post(`${getStore().env.CANON_API}/api/materializers/${currentPid}?locale=${thisLocale}${paramString}`, {variables: variables[thisLocale]}).then(mat => {
variables[thisLocale] = nestedObjectAssign({}, variables[thisLocale], mat.data);
variables[thisLocale] = assign({}, variables[thisLocale], mat.data);
dispatch({type: "VARIABLES_SET", data: {id: currentPid, diffCounter, variables}});
});
}
Expand Down
35 changes: 0 additions & 35 deletions packages/cms/src/utils/nestedObjectAssign.js

This file was deleted.

0 comments on commit 0142dae

Please sign in to comment.