Changed api show and store method..

This commit is contained in:
Cüneyt Şentürk
2021-05-30 02:43:12 +03:00
parent 78016a1a94
commit dd9a10febd
18 changed files with 38 additions and 38 deletions

View File

@ -39,7 +39,7 @@ class Accounts extends ApiController
$account = Account::where('number', $id)->first();
}
return $this->response->item($account, new Transformer());
return $this->item($account, new Transformer());
}
/**
@ -52,7 +52,7 @@ class Accounts extends ApiController
{
$account = $this->dispatch(new CreateAccount($request));
return $this->response->created(route('api.accounts.show', $account->id));
return $this->response->created(route('api.accounts.show', $account->id), $this->item($account, new Transformer()));
}
/**

View File

@ -32,7 +32,7 @@ class Reconciliations extends ApiController
*/
public function show(Reconciliation $reconciliation)
{
return $this->response->item($reconciliation, new Transformer());
return $this->item($reconciliation, new Transformer());
}
/**
@ -45,7 +45,7 @@ class Reconciliations extends ApiController
{
$reconciliation = $this->dispatch(new CreateReconciliation($request));
return $this->response->created(route('api.reconciliations.show', $reconciliation->id));
return $this->response->created(route('api.reconciliations.show', $reconciliation->id), $this->item($reconciliation, new Transformer()));
}
/**

View File

@ -32,7 +32,7 @@ class Transactions extends ApiController
*/
public function show(Transaction $transaction)
{
return $this->response->item($transaction, new Transformer());
return $this->item($transaction, new Transformer());
}
/**
@ -45,7 +45,7 @@ class Transactions extends ApiController
{
$transaction = $this->dispatch(new CreateTransaction($request));
return $this->response->created(route('api.transactions.show', $transaction->id));
return $this->response->created(route('api.transactions.show', $transaction->id), $this->item($transaction, new Transformer()));
}
/**

View File

@ -62,7 +62,7 @@ class Transfers extends ApiController
*/
public function show(Transfer $transfer)
{
return $this->response->item($transfer, new Transformer());
return $this->item($transfer, new Transformer());
}
/**
@ -75,7 +75,7 @@ class Transfers extends ApiController
{
$transfer = $this->dispatch(new CreateTransfer($request));
return $this->response->created(route('api.transfers.show', $transfer->id));
return $this->response->created(route('api.transfers.show', $transfer->id), $this->item($transfer, new Transformer()));
}
/**