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

Completed The Tasks #4

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

Tarun-Arora
Copy link

@Tarun-Arora Tarun-Arora commented Jun 27, 2021

CSOC Task 3 Submission

I have completed the following tasks

  • Login
  • auth_required.js and no_auth_required.js
  • Add Task
  • Get Tasks
  • Edit Task
  • Delete Task

/***
* @todo Redirect the user to login page if token is not present.
*/
const checkLogin = () => {
// console.log(document.cookie);
if(document.cookie=='')window.location.href = './login'
Copy link
Member

Choose a reason for hiding this comment

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

Make use of Framework specific methods rather than using Vanilla JS one

Copy link
Author

Choose a reason for hiding this comment

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

So I have to use router instead of window.location.href and rather than checking document.cookie again and again I should use State ??
Is that all or I am still missing something?

Copy link
Member

Choose a reason for hiding this comment

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

Yes

Copy link
Author

Choose a reason for hiding this comment

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

I made a few changes to resolve those mistakes. Please review them.

}
const API_BASE_URL = 'https://todo-app-csoc.herokuapp.com/'
const dataForApiRequest = {
username: document.getElementById('inputUsername').value,
Copy link
Member

Choose a reason for hiding this comment

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

You should have make use of React Hooks like useState to manage the states

@KKVANONYMOUS KKVANONYMOUS mentioned this pull request Jul 6, 2021
6 tasks
@Tarun-Arora Tarun-Arora requested a review from KKVANONYMOUS July 8, 2021 13:34
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