MxIllusionment / rpg-manager

A generic manager for RPG characters and their inventories
1 stars 1 forks source link

API: Inventory Management #10

Closed MxIllusionment closed 3 years ago

MxIllusionment commented 3 years ago

Handles the inventory for a specific character, allowing items in the item list to be added, deleted, and have quantity changed.

GET: /api/characters/:character-id/inventory Returns item ID, item Name, and item Quantity for all items in a character's inventory

POST: /api/characters/:character-id/inventory Send JSON with item ID to add that item to a character's inventory

DELETE: /api/characters/:character-id/inventory/:item-id Remove an item from a character's inventory

PUT: /api/characters/:character-id/inventory/:item-id Send JSON with item Quantity to update that item's quantity in the character's inventory

MxIllusionment commented 3 years ago

GET JSON:

{
  id: number,
  name: string,
  quantity: number
}

POST JSON:

{
  id: number
}

PUT JSON:

{
  quantity: number
}