Skip to content

Commit

Permalink
fix(admin editor): only use Sefaria.normRef() which also does encodeU…
Browse files Browse the repository at this point in the history
…RIComponent()
  • Loading branch information
nsantacruz committed Jun 24, 2024
1 parent eb396e2 commit c4b08ce
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion static/js/SourceEditor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ const SourceEditor = ({topic, close, origData={}}) => {
}

const deleteTopicSource = function() {
const url = `/api/ref-topic-links/${encodeURIComponent(origData.ref)}?topic=${topic}&interface_lang=${Sefaria.interfaceLang}`;
const url = `/api/ref-topic-links/${Sefaria.normRef(origData.ref)}?topic=${topic}&interface_lang=${Sefaria.interfaceLang}`;
Sefaria.adminEditorApiRequest(url, null, null, "DELETE")
.then(() => window.location.href = `/topics/${topic}`);
}
Expand Down
2 changes: 1 addition & 1 deletion static/js/sefaria/sefaria.js
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ Sefaria = extend(Sefaria, {
return await Sefaria.apiRequestWithBody(`/api/subscribe/steinsaltz/${email}`, null, payload);
},
postRefTopicLink: function(refInUrl, payload) {
const url = `/api/ref-topic-links/${encodeURIComponent(Sefaria.normRef(refInUrl))}`;
const url = `/api/ref-topic-links/${Sefaria.normRef(refInUrl)}`;
// payload will need to be refactored once /api/ref-topic-links takes a more standard input
return Sefaria.adminEditorApiRequest(url, null, payload);
},
Expand Down

0 comments on commit c4b08ce

Please sign in to comment.