question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bug: API endpoint /objects/products returns error for barcode and userfields

See original GitHub issue

How to reproduce

  1. Open https://demo.grocy.info/api
  2. Select the endpoint (POST) /objects/{entity}
  3. Select “products” as an entity
  4. Keep the default request body
  5. Click on Execute image

The following error will be shown:

{
  "error_message": "SQLSTATE[HY000]: General error: 1 table products has no column named barcode"
}

Screenshot 2022-10-12 at 19 55 11

A similar issue is observed with the userfields parameter in the request.

The issue is present in both: actual and pre-release versions.

Update: The same issue is present in the PUT request

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
berrndcommented, Oct 12, 2022

It seems that there is no way how one can add/modify the barcodes of products via API.

Can’t be true for just like everything, since the web frontend uses the API for anything. So the most simple way to find out how things work is to use the UI, while also having a look at your favorite browsers developer tools and see what actually happens.

Use the “Generic entity interactions” endpoints and the entity product_barcodes to add/edit/delete product barcodes.

0reactions
vfhrrcommented, Oct 12, 2022

@berrnd sure, I would be glad to fix the documentation, but there is a very concrete part that doesn’t work at the moment: It seems that there is no way how one can add/modify the barcodes of products via API.

As I was relying on the documentation, I thought there is a possibility to do it, but seems that it is just a bug in documentation, and it is not possible to do it via API, am I right? In this case, I will create a feature request instead and fix the documentation meanwhile.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Feature Request: Quantity conversion factors for barcodes
So I have one product, with several different barcodes and each barcode is ... grocy Bug: API endpoint /objects/products returns error for ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found