Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: create the storage to manage the app state #4

Merged
merged 2 commits into from
Aug 30, 2023

Conversation

dcoa
Copy link
Collaborator

@dcoa dcoa commented Aug 28, 2023

Create Data Storage
This PR creates the storage to manage the app state and the connection with the backend.

The functions were created considering the technical documentation but could be modified in the future according to any API specification.

How to test

  1. Modify the ValidationPanelPage to display the information in the browser
import { useEffect } from 'react';
import { useDispatch, useSelector } from 'react-redux';
import { getCourses } from './data/thunks';

const ValidationPanelPage = () => {
  const { courses } = useSelector(state => state.courses);
  const dispatch = useDispatch();

  useEffect(() => {
    dispatch(getCourses());
  }, [dispatch]);

  return (
    <div>{courses.map(({ courseId }) => <h1>{courseId}</h1>)}</div>
  );
};

export default ValidationPanelPage;
  1. You should see the course ID for each course visible to the current user.

Note: this exmple use the course API http://<your_lms>:8000/api/courses/v1/courses/?username=<current_user>
JIRA CARD

You can use a mock api rest to test the validation API.

@dcoa dcoa marked this pull request as ready for review August 28, 2023 14:15
@dcoa dcoa requested review from Alec4r and bra-i-am August 28, 2023 14:18
Copy link
Contributor

@bra-i-am bra-i-am left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@bra-i-am bra-i-am merged commit 4ca0b6e into master Aug 30, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants