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

Update company #88

Open
mu1664al-s opened this issue Aug 31, 2021 · 2 comments
Open

Update company #88

mu1664al-s opened this issue Aug 31, 2021 · 2 comments

Comments

@mu1664al-s
Copy link
Member

mu1664al-s commented Aug 31, 2021

When trying to update a company as admin, the fallowing error is generated at the backend and it fails.

[error] Ranch protocol #PID<0.506.0> of listener Nexpo.Endpoint.HTTP (cowboy_protocol) terminated
** (exit) an exception was raised:
    ** (FunctionClauseError) no function clause matching in :cow_uri.urldecode/2
        (cowboy 1.1.2) /workspace/deps/cowboy/src/cow_uri.erl:26: :cow_uri.urldecode("[object%20Object]", "")
        (cowboy 1.1.2) /workspace/deps/cowboy/src/cowboy_router.erl:331: :cowboy_router."-split_path/2-lc$^1/1-1-"/1
        (cowboy 1.1.2) /workspace/deps/cowboy/src/cowboy_router.erl:331: :cowboy_router.split_path/2
        (cowboy 1.1.2) /workspace/deps/cowboy/src/cowboy_router.erl:334: :cowboy_router.split_path/2
        (cowboy 1.1.2) /workspace/deps/cowboy/src/cowboy_router.erl:271: :cowboy_router.match_path/4
        (cowboy 1.1.2) /workspace/deps/cowboy/src/cowboy_router.erl:169: :cowboy_router.execute/2
        (cowboy 1.1.2) /workspace/deps/cowboy/src/cowboy_protocol.erl:442: :cowboy_protocol.execute/4
[error] Process #PID<0.506.0> raised an exception
** (FunctionClauseError) no function clause matching in :cow_uri.urldecode/2
    (cowboy 1.1.2) /workspace/deps/cowboy/src/cow_uri.erl:26: :cow_uri.urldecode("[object%20Object]", "")
    (cowboy 1.1.2) /workspace/deps/cowboy/src/cowboy_router.erl:331: :cowboy_router."-split_path/2-lc$^1/1-1-"/1
    (cowboy 1.1.2) /workspace/deps/cowboy/src/cowboy_router.erl:331: :cowboy_router.split_path/2
    (cowboy 1.1.2) /workspace/deps/cowboy/src/cowboy_router.erl:334: :cowboy_router.split_path/2
    (cowboy 1.1.2) /workspace/deps/cowboy/src/cowboy_router.erl:271: :cowboy_router.match_path/4
    (cowboy 1.1.2) /workspace/deps/cowboy/src/cowboy_router.erl:169: :cowboy_router.execute/2
    (cowboy 1.1.2) /workspace/deps/cowboy/src/cowboy_protocol.erl:442: :cowboy_protocol.execute/4

On client side.

Proxy error: Could not proxy request /api/companies/[object%20Object] from localhost:3000 to http://127.0.0.1:4000.
See https://nodejs.org/api/errors.html#errors_common_system_errors for more information (ECONNRESET).
@emarforio
Copy link
Contributor

I think I know what causes this, I will insvestigate more but I suspect that it is the frontend that does not serialize the company id in the url correctly and therefore the backend is not able to parse it.

@mu1664al-s
Copy link
Member Author

mu1664al-s commented Sep 7, 2021

I think I know what causes this, I will insvestigate more but I suspect that it is the frontend that does not serialize the company id in the url correctly and therefore the backend is not able to parse it.

I have fixed it. There are just two tests failing but I know why. You are right about the frontend but there was also a major issue in backend. It seems like the ability for admin to change the profile image was added later. There was no proper endpoint to handle it and the controller that should work couldn't handle multipart form data.

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

No branches or pull requests

2 participants