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

🐛 [Bug]: Internal server error adding new product #149

Closed
3 tasks done
chr15m opened this issue Jul 30, 2024 · 0 comments · Fixed by #151
Closed
3 tasks done

🐛 [Bug]: Internal server error adding new product #149

chr15m opened this issue Jul 30, 2024 · 0 comments · Fixed by #151
Labels
☢️ Bug Something isn't working

Comments

@chr15m
Copy link

chr15m commented Jul 30, 2024

Bug Description

I started the server and added a new product. I clicked the "Add" button and it didn't appear to do anything. I clicked it again and then started getting this error. Here's a screenshot of the UI:

image

Log:

{"level":"info","ip":"127.0.0.1","latency":"881.549µs","status":200,"method":"POST","url":"/api/_/products","time":1722347820,"message":"Success"}
{"level":"error","caller":"/home/runner/work/litecart/litecart/internal/handlers/private/product.go:47","error":"constraint failed: UNIQUE constraint failed: product.slug (2067)","time":1722347823}

When I refreshed the page it turned out the product had already been crated.

How to Reproduce

  1. Go to the UI to add a product.
  2. Input some details and press "Save".
  3. Press "Save" again when it doesn't save.
  4. See the error.

Expected Behavior

If the product has been added I'd expect it to show up in the product list behind the form so it's clear it's already been added, and maybe a more informative error message telling me it's already been added. Maybe the button should be greyed out once clicked.

litecart Version

v0.1.12

Code Snippet (optional)

No response

Checklist:

  • I agree to follow litecart's Code of Conduct.
  • I have checked for existing issues that describe my problem prior to opening this one.
  • I understand that improperly formatted bug reports may be closed without explanation.
@chr15m chr15m added the ☢️ Bug Something isn't working label Jul 30, 2024
@shurco shurco linked a pull request Jul 31, 2024 that will close this issue
12 tasks
@shurco shurco reopened this Jul 31, 2024
@shurco shurco closed this as completed Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
☢️ Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants