julkascript / cardflow

The open-source Trading Card Game market
MIT License
15 stars 9 forks source link

Changing card after editing. #52

Closed ZhivkoTringov closed 9 months ago

ZhivkoTringov commented 9 months ago

A bug han been discovered during test. The bug appears after you edit a listed card. For example, you have listed "Dark Hole" card. When you edit the price, quantity, or state of the card, and appy the change, the card is replaced by another card. In this case with"Apollousa, Bow of the Goddess". I'm providing you the payload and the response.

Payload:

{
   "quantity":1,
   "condition":"good",
   "price":2,
   "is_sold":false,
   "is_listed":true,
   "card":15
}
"card":"15
condition":"good""is_listed":"true
is_sold":"false
price":"2
quantity":1

Responce:

{
    "id": 15,
    "card": 15,
    "card_name": "Anti-Spell Fragrance",
    "card_set_id": 13,
    "card_in_set": {
        "id": 15,
        "yugioh_card": {
            "id": 2,
            "card_name": "Anti-Spell Fragrance",
            "type": "Trap Card",
            "frame_type": "trap",
            "description": "Both players must Set Spell Cards before activating them, and cannot activate them until their next turn after Setting them.",
            "attack": "NULL",
            "defense": "NULL",
            "level": "NULL",
            "race": "Continuous",
            "attribute": "NULL",
            "archetype": "Anti",
            "image": "https://images.ygoprodeck.com/images/cards/58921041.jpg"
        },
        "set": {
            "id": 13,
            "card_set_name": "Yu-Gi-Oh! Power of Chaos: Yugi the Destiny promotional cards",
            "set_code": "PCY"
        },
        "rarity": {
            "id": 10,
            "rarity": "Prismatic Secret Rare",
            "rarity_code": "(PScR)"
        }
    },
    "user": 2,
    "user_name": "milensski",
    "price": 2.0,
    "condition": "good",
    "quantity": 1,
    "is_listed": true,
    "is_sold": false
}

Hyperlink for all listed cards is missing too. So when user login to his/her account there is no hyperlink for all the cards that he/she listed.

RyotaMitaraiWeb commented 9 months ago

I will investigate the card shifting bug and try to submit a PR this evening, alongside integrating an existing component or creating new links to the /sell pages