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

Won giveaways have a different URL #104

Closed
rinoma opened this issue Jun 11, 2019 · 2 comments · Fixed by #107
Closed

Won giveaways have a different URL #104

rinoma opened this issue Jun 11, 2019 · 2 comments · Fixed by #107
Labels
bug Something isn't working

Comments

@rinoma
Copy link
Contributor

rinoma commented Jun 11, 2019

When a giveaway is already entered, the URL is saved in the DB. However, the url format of a giveaway that has already been won is different:
Screenshot 2019-06-10 at 21 34 22
When the url is saved it contains the string /ga/won/.
When searching the db, it is searched with /ga/p/ and it isn't found.
The winning url is saved again in the db.
An error is returned because the url is not unique.

@jpchip jpchip added the bug Something isn't working label Jun 11, 2019
@jpchip
Copy link
Owner

jpchip commented Jun 11, 2019

Here's my thought: We always get the giveaway url to do the is skippable test. What if we store that as currentGiveawayUrl in the giveaways.js file, and we use it everywhere? Then it will always be saving the /ga/p/ version of the url even if you win? See my changes here:

https://github.com/jpchip/giveaway-grabber/blob/log-price-check/src/giveaways.js

@rinoma
Copy link
Contributor Author

rinoma commented Jun 12, 2019

The way you did it looks fine to me.

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