[Enhance] API for redeem

- Add API endpoints for redeem system
- Continue to fix the bug mentioned in 930faf508d
This commit is contained in:
Lost-MSth
2023-02-28 18:28:09 +08:00
parent 930faf508d
commit a84ec560dd
15 changed files with 283 additions and 50 deletions

View File

@@ -119,7 +119,7 @@ def purchases_purchase_items_patch(data, user, purchase_name: str):
p = Purchase(c)
p.purchase_name = purchase_name
p.select_items()
p.delete_items([ItemFactory.from_dict(x, c=c)
p.remove_items([ItemFactory.from_dict(x, c=c)
for x in data.get('remove', [])])
p.add_items([ItemFactory.from_dict(x, c=c)
for x in data.get('create', [])])