Untitled
unknown
javascript
2 years ago
715 B
12
Indexable
function store(Request $request)
{
$data = $request->only(['indebted', 'creditor', 'type', 'notes', 'account_to', 'account_from']);
try {
$result = $this->transactionService->saveTransactionData($data);
return $this->apiResponse($result, $this->SUCCESS_MESSAGE, $this->SUCCESS_CODE);
} catch (\InvalidArgumentException $e) {
Log::error($e->getMessage());
return $this->apiResponse('', $e->getMessage(), $this->INVALID_PARAMETERS_ERROR_CODE);
} catch (\Exception $e) {
Log::error($e->getMessage());
return $this->apiResponse('', $e->getMessage(), $this->SERVER_ERROR_CODE);
}
}Editor is loading...