Skip to content

Commit

Permalink
feat: add cookie library
Browse files Browse the repository at this point in the history
  • Loading branch information
LauraFgar committed Dec 6, 2023
1 parent 4c7acfa commit 95196cc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
3 changes: 2 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"core-js": "3.22.2",
"history": "5.3.0",
"joi": "^17.11.0",
"js-cookie": "3.0.5",
"js-cookie": "^3.0.5",
"lodash.camelcase": "4.3.0",
"prop-types": "15.8.1",
"query-string": "^7.1.3",
Expand Down
8 changes: 3 additions & 5 deletions src/services/APIServices.jsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import {
getConfig,
} from '@edx/frontend-platform';
import Cookies from 'js-cookie';
import { getConfig } from '@edx/frontend-platform';
class APIService {
visit = async (course_id, block_id) => {
const URL = `/api/v1/courses/course/${course_id}/block/${block_id}/visit`;
const lmsSessionIdCookie = document.cookie.replace(/(?:(?:^|.*;\s*)lms_sessionid\s*=\s*([^;]*).*$)|^.*$/, '$1');

const lmsSessionIdCookie = Cookies.get('lms_sessionid');
console.log('COOKIESSS', lmsSessionIdCookie)
try {
const response = await fetch(getConfig().API_GW_URL + URL, {
Expand Down

0 comments on commit 95196cc

Please sign in to comment.