Open geekelo opened 2 months ago
The Api::V1::P2pTrades::OnlineWalletsController
manages online wallet operations in a P2P trading context. Here’s a breakdown of its functionality:
This controller handles operations related to online wallets, including retrieving, creating, and deleting wallets.
index
:
online_wallets
method from the included helper module to fetch the list.create
:
P2pApi::Requests::OnlineWallet::CreateService
to handle the creation.profile
: The current user's profile.params
: Parameters for creating the online wallet.200
or 201
, clears the cache and renders the response.destroy
:
P2pApi::OnlineWallet::DeleteJob
to perform the deletion and clears the cache.403 Forbidden
response.destroy
action includes an authorization check to ensure only valid requests can delete wallets.This structure helps maintain clean, readable code by separating concerns and leveraging service objects for business logic.