Skip to content

Commit

Permalink
Upgrade facia-scala-client to 3.0.19; add code to handle uri-encoded …
Browse files Browse the repository at this point in the history
…params
  • Loading branch information
jonathonherbert committed Dec 6, 2019
1 parent 879ed11 commit d7f197a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ libraryDependencies ++= Seq(
"com.gu" %% "content-api-client-aws" % "0.5",
"com.gu" %% "content-api-client-default" % capiClientVersion,
"com.gu" %% "editorial-permissions-client" % "2.0",
"com.gu" %% "fapi-client-play26" % "3.0.18-SNAPSHOT",
"com.gu" %% "fapi-client-play26" % "3.0.19",
"com.gu" % "kinesis-logback-appender" % "1.4.2",
"com.gu" %% "mobile-notifications-api-models" % "1.0.5",
"com.gu" %% "pan-domain-auth-play_2-6" % "0.7.2",
Expand Down
4 changes: 3 additions & 1 deletion public/src/js/modules/content-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import * as cache from 'modules/cache';
import modalDialog from 'modules/modal-dialog';
import internalPageCode from 'utils/internal-page-code';
import articlePath from 'utils/article-path';
import urlQuery from 'utils/url-query';
import isGuardianUrl from 'utils/is-guardian-url';
import lenientJsonParse from 'utils/lenient-json-parse';
import mediator from 'utils/mediator';
Expand Down Expand Up @@ -95,7 +96,8 @@ function validateItem (item) {
populate(item, capiItem);
cache.put('contentApi', pageCode, capiItem);

const maybeBlockId = item.id().split('#block-')[1];
const maybeUrlParams = decodeURIComponent(urlQuery(item.id()))
const maybeBlockId = maybeUrlParams.split('with:block-')[1];

if (maybeBlockId) {
item.meta.blockId(maybeBlockId);
Expand Down

0 comments on commit d7f197a

Please sign in to comment.