mirror of
https://github.com/danielbrendel/hortusfox-web.git
synced 2026-05-08 14:49:41 -05:00
#276 Increment amount
This commit is contained in:
@@ -617,6 +617,31 @@ class ApiController extends BaseController {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles URL: /api/inventory/amount/inc
|
||||
*
|
||||
* @param Asatru\Controller\ControllerArg $request
|
||||
* @return Asatru\View\JsonHandler
|
||||
*/
|
||||
public static function inc_inventory_item($request)
|
||||
{
|
||||
try {
|
||||
$item = $request->params()->query('item', null);
|
||||
|
||||
$amount = InventoryModel::incAmount($item, true);
|
||||
|
||||
return json([
|
||||
'code' => 200,
|
||||
'amount' => $amount
|
||||
]);
|
||||
} catch (\Exception $e) {
|
||||
return json([
|
||||
'code' => 500,
|
||||
'msg' => $e->getMessage()
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles URL: /api/chat/message/add
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user