dinoperovic / django-salesman

Headless e-commerce framework for Django and Wagtail.
https://django-salesman.rtfd.io
BSD 3-Clause "New" or "Revised" License
384 stars 46 forks source link

Add PATCH endpoint for basket item "extra" data #45

Open thenewguy opened 5 months ago

thenewguy commented 5 months ago

It would be helpful if there was an endpoint one could use to patch extra key values like:

<form 
    hx-patch="{% endverbatim %}{% url 'salesman-basket-list' %}{% verbatim %}{{ ref }}/"
    hx-swap="none"
>
    <input type="number" name="unit_price_override" value="{{ unit_price }}" min="0" step="0.01">
    <button type="submit" class="btn btn-primary" data-bs-dismiss="modal">Submit</button>
</form>

The result of submitting the form should be that the unit_price_override key in the basket item extra dict is set to the submitted value without modifying the other keys of the extra data.