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-All-TASKS!!! #6

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

Conversation

Ankur-Agrawal-ece20
Copy link

@Ankur-Agrawal-ece20 Ankur-Agrawal-ece20 commented Jun 28, 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

export function Authorized(token){
if (token) {
console.log("Welcome Back!");
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 redirected the already logged In user to the index page

Copy link
Author

Choose a reason for hiding this comment

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

I redirected user to homepage now by changing auth_required.js and no_auth_required.js. Please, review now!

Copy link
Author

Choose a reason for hiding this comment

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

Sorry for the delay in making changes due to endsems.

const { login,API_BASE_URL,setpagetype } = useAuth()
useEffect(()=>{setpagetype("LOGIN");return;},[])
const loginnow = () => {
const user_name = document.getElementById("inputUsername").value.trim();
Copy link
Member

Choose a reason for hiding this comment

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

Use React Hooks like useState instead of Vanilla JS

Copy link
Author

Choose a reason for hiding this comment

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

I have updated login form. Please. review now.

const addTask = (e) => {
e.preventDefault()
if (!Todotxt || Todotxt=="") {
return;
Copy link
Member

Choose a reason for hiding this comment

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

Should have added some Error or Warning Toast

Copy link
Author

Choose a reason for hiding this comment

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

Added error message in add task. Please, review again.

* @todo 2. Update the task in the dom.
*/
if (!Newdata) {
return;
Copy link
Member

Choose a reason for hiding this comment

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

Warning toast missing!

Copy link
Author

Choose a reason for hiding this comment

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

Added warning toast in update method. Please, review again.

Added error message.
Used react hooks!
Added error message in update method!
Passed functions to no_auth_required.js !
Added function to redirect user to homepage!
Sorry for changes again, now finally added warning message.
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