django-salesman icon indicating copy to clipboard operation
django-salesman copied to clipboard

Add PATCH endpoint for basket item "extra" data

Open thenewguy opened this issue 10 months ago • 0 comments

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.

thenewguy avatar Apr 23 '24 20:04 thenewguy