API Flutter Patch 2
This commit is contained in:
parent
59aa63be93
commit
1f7ecb22be
@ -8,20 +8,20 @@ use Illuminate\Http\Request;
|
|||||||
|
|
||||||
class InvoiceApiController extends Controller
|
class InvoiceApiController extends Controller
|
||||||
{
|
{
|
||||||
public function getInvoice($id)
|
public function getInvoice(Request $request)
|
||||||
{
|
{
|
||||||
return response()->json([
|
return response()->json([
|
||||||
'transaction' => Transaction::findOrFail($id),
|
'transaction' => Transaction::findOrFail($request->input('id')),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function exportInvoice($id)
|
public function exportInvoice(Request $request)
|
||||||
{
|
{
|
||||||
// $transaction = Transaction::findOrFail($request->id);
|
// $transaction = Transaction::findOrFail($request->id);
|
||||||
// $pdf = Pdf::loadView('invoice.export-invoice',compact('transaction'))->setPaper('A4','Portrait');
|
// $pdf = Pdf::loadView('invoice.export-invoice',compact('transaction'))->setPaper('A4','Portrait');
|
||||||
// return $pdf->download("invoice-$request->id.pdf");
|
// return $pdf->download("invoice-$request->id.pdf");
|
||||||
return response()->json([
|
return response()->json([
|
||||||
'transaction' => Transaction::findOrFail($id),
|
'transaction' => Transaction::findOrFail($request->input('id')),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,9 +15,9 @@ use App\Models\TransactionDescription;
|
|||||||
|
|
||||||
class RefundApiController extends Controller
|
class RefundApiController extends Controller
|
||||||
{
|
{
|
||||||
public function createRefund($id)
|
public function createRefund(Request $request)
|
||||||
{
|
{
|
||||||
return response()->json(['transaction_id' => $id]);
|
return response()->json(['transaction_id' => $request->input('id')]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function storeRefund(Request $request){
|
public function storeRefund(Request $request){
|
||||||
@ -87,9 +87,9 @@ class RefundApiController extends Controller
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDetailRefund($id){
|
public function getDetailRefund(Request $request){
|
||||||
$refund = Refund::find($id);
|
$refund = Refund::find($request->input('id'));
|
||||||
$refundDescription = RefundDescription::where('refund_id',$id)->get();
|
$refundDescription = RefundDescription::where('refund_id',$request->input('id'))->get();
|
||||||
return response()->json([
|
return response()->json([
|
||||||
'refund' => $refund,
|
'refund' => $refund,
|
||||||
'descriptions' => $refundDescription
|
'descriptions' => $refundDescription
|
||||||
|
@ -9,19 +9,19 @@ use App\Models\Transaction;
|
|||||||
|
|
||||||
class TransactionApiController extends Controller
|
class TransactionApiController extends Controller
|
||||||
{
|
{
|
||||||
public function getTrackingTransaction($id){
|
public function getTrackingTransaction(Request $request){
|
||||||
$data = TransactionDescription::where('transaction_id', $id)->get();
|
$data = TransactionDescription::where('transaction_id', $request->input('id'))->get();
|
||||||
|
|
||||||
return response()->json([
|
return response()->json([
|
||||||
'data' => $data
|
'data' => $data
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDetailTransaction($id)
|
public function getDetailTransaction(Request $request)
|
||||||
{
|
{
|
||||||
return response()->json([
|
return response()->json([
|
||||||
'transaction' => Transaction::findOrFail($id),
|
'transaction' => Transaction::findOrFail($request->input('id')),
|
||||||
'trackings' => TransactionDescription::where('transaction_id', $id)
|
'trackings' => TransactionDescription::where('transaction_id', $request->input('id'))
|
||||||
->latest()
|
->latest()
|
||||||
->get(),
|
->get(),
|
||||||
]);
|
]);
|
||||||
|
@ -75,14 +75,14 @@ Route::middleware(['auth:api'])->group(function () {
|
|||||||
}); // sudah
|
}); // sudah
|
||||||
|
|
||||||
Route::controller(TransactionApiController::class)->group(function () {
|
Route::controller(TransactionApiController::class)->group(function () {
|
||||||
Route::get('get-transaction-tracking/{id}', 'getTrackingTransaction')->name('transaction.get-transaction-tracking');
|
Route::get('get-transaction-tracking', 'getTrackingTransaction')->name('transaction.get-transaction-tracking');
|
||||||
Route::get('get-detail-transaction/{id}', 'getDetailTransaction')->name('transaction.get-detail-transaction');
|
Route::get('get-detail-transaction', 'getDetailTransaction')->name('transaction.get-detail-transaction');
|
||||||
}); // sudah
|
}); // sudah
|
||||||
|
|
||||||
Route::controller(RefundApiController::class)->group(function () {
|
Route::controller(RefundApiController::class)->group(function () {
|
||||||
Route::get('list-refund', 'listRefund')->name('refund.list-refund');
|
Route::get('list-refund', 'listRefund')->name('refund.list-refund');
|
||||||
Route::get('create-refund/{id}','createRefund')->name('refund.create-refund');
|
Route::get('create-refund','createRefund')->name('refund.create-refund');
|
||||||
Route::get('detail-refund/{id}','getDetailRefund')->name('refund.get-detail-refund');
|
Route::get('detail-refund','getDetailRefund')->name('refund.get-detail-refund');
|
||||||
Route::post('store-refund', 'storeRefund')->name('refund.store-refund');
|
Route::post('store-refund', 'storeRefund')->name('refund.store-refund');
|
||||||
}); // sudah
|
}); // sudah
|
||||||
|
|
||||||
@ -114,8 +114,8 @@ Route::middleware(['auth:api'])->group(function () {
|
|||||||
}); // sudah
|
}); // sudah
|
||||||
|
|
||||||
Route::controller(InvoiceApiController::class)->group(function () {
|
Route::controller(InvoiceApiController::class)->group(function () {
|
||||||
Route::get('get-invoice/{id}', 'getInvoice')->name('invoice.get-invoice');
|
Route::get('get-invoice', 'getInvoice')->name('invoice.get-invoice');
|
||||||
Route::get('export-invoice/{id}', 'exportInvoice')->name('invoice.export-invoice');
|
Route::get('export-invoice', 'exportInvoice')->name('invoice.export-invoice');
|
||||||
}); // sudah
|
}); // sudah
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user