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

Cindyrzheng/dropclass #66

Merged
merged 25 commits into from
Mar 7, 2022
Merged

Cindyrzheng/dropclass #66

merged 25 commits into from
Mar 7, 2022

Conversation

cindyrzheng
Copy link
Collaborator

some drop class stuff, has been weirldy merged so need to review rn

krashanoff and others added 4 commits February 22, 2022 16:00
@1strangequark
Copy link
Collaborator

This all looks good to me, Cindy.

@cindyrzheng
Copy link
Collaborator Author

This all looks good to me, Cindy.

Rolled back to when Jonathan wrote this, and then changed an error statement.

@cindyrzheng
Copy link
Collaborator Author

Still have not tested this since Im not too sure how to get ahold of a student ID

@cindyrzheng cindyrzheng changed the base branch from main to cindyrzheng/linkfixes March 7, 2022 08:21
@cindyrzheng cindyrzheng changed the base branch from cindyrzheng/linkfixes to main March 7, 2022 08:22
@cindyrzheng cindyrzheng marked this pull request as draft March 7, 2022 10:01
@cindyrzheng
Copy link
Collaborator Author

Left as a draft since I'm getting a 400 bad request response. will investigate more in the morn! gotta sleep now :(

@cindyrzheng
Copy link
Collaborator Author

cindyzheng@Cindys-MacBook-Pro backend % curl -X POST localhost:8080/class/1/drop -H 'Content-Type: application/json' -H 'Authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwiZXhwIjoxNjQ5MjM0ODk2LCJuYmYiOjE2NDY2NDI4OTZ9.bEHhDL_ztP2_xc7-M66A6nlXg9Xei7nNIG1WCV-rv94' -d ‘{“classId”:”1”,”studentId”:”1”}’
curl: (3) URL using bad/illegal format or missing URL

Not sure what's going on but I think there might be a problem with the drop endpoint! @pkrish20 @svetly-t @krashanoff

@krashanoff
Copy link
Collaborator

Move your URL to the end of the cURL command.

@cindyrzheng
Copy link
Collaborator Author

eyJpZCI6MSwiZXhwIjoxNjQ5MjM0ODk2LCJuYmYiOjE2NDY2NDI4OTZ9.bEHhDL_ztP2_xc7-M66A6nlXg9Xei7nNIG1WCV-rv94' -d ‘{“classId”:”1”,”studentId”:”1”}’

cindyzheng@Cindys-MacBook-Pro backend % curl -X POST -H 'Content-Type: application/json' -H 'Authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwiZXhwIjoxNjQ5MjM0ODk2LCJuYmYiOjE2NDY2NDI4OTZ9.bEHhDL_ztP2_xc7-M66A6nlXg9Xei7nNIG1WCV-rv94' -d ‘{“classId”:”1”,”studentId”:”1”}’  localhost:8080/class/1/drop
curl: (3) URL using bad/illegal format or missing URL 

😭

@krashanoff
Copy link
Collaborator

krashanoff commented Mar 7, 2022

The issue you're encountering in your command is malforming the cURL command - that's why it says curl: (3) URL using.... That's not something from our server, but cURL. I think it's because you're using weird double-quotes, rather than standard ASCII ones (see {“classId”:”1”,”studentId”:”1”} compared to {"classId": "1", "studentId": "1"}). The following commands run fine for me:

image

Anyways, there were a few things wrong in the command, and I messed up a few times using it here anyways. On the left side, you can see the output of the backend, and on the right, my commands. We can see that the server complained that our request was bad a few times (400). Fixing the format by changing it to use id instead of studentId, we then we got an auth issue a few times (401) because we tried to drop the professor from the class. Changing the id field to the student ID, 2, the request succeeds.

@cindyrzheng cindyrzheng changed the base branch from main to fixsignup March 7, 2022 22:16
@cindyrzheng cindyrzheng changed the base branch from fixsignup to main March 7, 2022 22:16
Copy link
Collaborator

@krashanoff krashanoff left a comment

Choose a reason for hiding this comment

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

Looks good following some nits!

frontend/src/api.ts Outdated Show resolved Hide resolved
frontend/src/ClassView/ClassList.tsx Outdated Show resolved Hide resolved
frontend/src/ClassView/ClassList.tsx Outdated Show resolved Hide resolved
cindyrzheng and others added 5 commits March 7, 2022 14:59
Co-authored-by: leo <leo@krashanoff.com>
Co-authored-by: leo <leo@krashanoff.com>
Co-authored-by: leo <leo@krashanoff.com>
@cindyrzheng cindyrzheng marked this pull request as ready for review March 7, 2022 23:02
@cindyrzheng cindyrzheng merged commit 93020ce into main Mar 7, 2022
@krashanoff krashanoff deleted the cindyrzheng/dropclass branch March 7, 2022 23:03
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.

3 participants