Ekerot / arkimera-robotics-project

0 stars 0 forks source link

Client - 404 when uploading file #191

Closed slim2k6 closed 7 years ago

slim2k6 commented 7 years ago

image

steps to reproduce: dropping the db, running the client and api, registering a new user (without seeding data), logging in, choose pdf in project postman directory to upload and press upload

slim2k6 commented 7 years ago

I can go through the same flow using postman. I can register, login and send file to a1 without problem. So looks like the problem is on the client.

slim2k6 commented 7 years ago

Register function in client is sending wrong data. See request payload and the appUrl. It should just be "student" which is what I entered in the form. but its a full url. The API only expects the "student" part as well. The rest is hardcoded and the user should not be able to change that. so in https://azoraone.azure-api.net/student/api/companies https://azoraone.azure-api.net/ - is hardcoded student - is what client should send when registering /api/companies - is hardcoced

image

tr222cj commented 7 years ago

Change: https://github.com/Ekerot/arkimera-robotics-project/blob/master/client/src/app/components/login/register/register.component.ts#L57

To:

const appUrl = this.registerForm.get('appUrl').value;

tr222cj commented 7 years ago

Helpers can probably be totaly removed after this since this is the only place it's being used.

slim2k6 commented 7 years ago

did what you wrote. didnt remove helpers though since you said probably and I wanna be sure :) heres a PR for that https://github.com/Ekerot/arkimera-robotics-project/pull/193

tr222cj commented 7 years ago

Will check and probably remove helpers later. For now this is closed.