Skip to content

Commit

Permalink
feat(Sefaria object): new post request to topic ref api endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
yonadavGit committed Jan 27, 2024
1 parent dbdc002 commit 7a068b0
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions static/js/sefaria/sefaria.js
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,25 @@ Sefaria = extend(Sefaria, {
const json = await response.json();
if (json.error) { throw json; }
return json;
},
updateTopicRef: async function(tref, text) {
const data = JSON.stringify(text)
const response = await fetch(`/api/ref-topic-links/${tref}`,
{
method: "POST",
mode: 'same-origin',
headers: {
'X-CSRFToken': Cookies.get('csrftoken'),
},
credentials: 'same-origin',
body: data
}
);
if (!response.ok) { throw "error"; }
const json = await response.json();
if (json.error) { throw json; }
console.log(json)
return json;
},
subscribeSefariaAndSteinsaltzNewsletter: async function(firstName, lastName, email, educatorCheck) {
const responses = await Promise.all([
Expand Down

0 comments on commit 7a068b0

Please sign in to comment.