Skip to content

Commit

Permalink
Remove query-string (#329)
Browse files Browse the repository at this point in the history
- Remove `query-string`.
- Use the `URLSearchParams` API to get join tokens for classrooms.
  • Loading branch information
eatyourgreens authored May 16, 2022
1 parent 0ad9615 commit 002943f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
11 changes: 8 additions & 3 deletions package-lock.json

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

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
"path-browserify": "~1.0.1",
"prop-types": "~15.8.1",
"punycode": "~2.1.1",
"query-string": "~5.0.0",
"react": "~16.14.0",
"react-copy-to-clipboard": "~5.1.0",
"react-dom": "~16.14.0",
Expand Down
4 changes: 2 additions & 2 deletions src/containers/common/JoinPageContainer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { Actions } from 'jumpstate';
import queryString from 'query-string';

import JoinPage from '../../components/common/JoinPage';
import {
Expand Down Expand Up @@ -39,7 +38,8 @@ export class JoinPageContainer extends React.Component {

joinClassroom(props, program) {
const classroomId = props.match.params.classroomId;
const joinToken = queryString.parse(props.location.search);
const searchParams = new URLSearchParams(props.location.search)
const joinToken = searchParams.get('joinToken');
const selectedProgram = program || props.selectedProgram;

Actions.joinClassroom({ classroomId, joinToken: joinToken.token })
Expand Down

0 comments on commit 002943f

Please sign in to comment.