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

[16.0] shopinvader_api_sale_loyalty: wrong write on GET /sales #1538

Open
simahawk opened this issue May 6, 2024 · 3 comments
Open

[16.0] shopinvader_api_sale_loyalty: wrong write on GET /sales #1538

simahawk opened this issue May 6, 2024 · 3 comments

Comments

@simahawk
Copy link
Contributor

simahawk commented May 6, 2024

@marielejeune are we sure we need to call _update_programs_and_rewards here?

I'm investigating an issue w/ permission when calling /sales. This is the error I get

It is forbidden to modify the following fields in a locked order:\nUnit Price

This comes from the write caused by the call to _update_programs_and_rewards and it looks suspicious to me because it will happen on GET calls for ALL the orders every time.

Plus, I can imagine that this will happen twice at least when on sync and update rewards a cart because this method is called explicitly there.

IMO we should not call this method here at all an rely on the updates to refresh this info and - in any case - it should be avoided on locked orders.

WDYT?

@simahawk
Copy link
Contributor Author

@marielejeune @lmignon gentle ping 😇

@marielejeune
Copy link
Contributor

Hi @simahawk

It isn't fresh in my mind anymore, but as far as I remember, I needed to call it in from_sale_order to be able to get all claimable rewards, otherwise none of them appear.
There may exist another solution and I'm open to it.

Unfortunately I won't have time to think about it now, I'm trying to finish what I have on my plate before my maternity leave coming in a few days now... 🐣

@simahawk
Copy link
Contributor Author

Hi Marie :)
Thanks for your feedback!

Hi @simahawk

It isn't fresh in my mind anymore, but as far as I remember, I needed to call it in from_sale_order to be able to get all claimable rewards, otherwise none of them appear. There may exist another solution and I'm open to it.

Ok, I'll do my research 😉

Unfortunately I won't have time to think about it now, I'm trying to finish what I have on my plate before my maternity leave coming in a few days now... 🐣

Wow! Take care then! Wish you all the bests 🤗

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