mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-05 18:52:44 +01:00
Add destroy() methods in all controllers
This commit is contained in:
parent
8c8509ca40
commit
c4bfb33dbf
@ -432,10 +432,11 @@ class ClientController extends BaseController
|
||||
*/
|
||||
public function destroy(DestroyClientRequest $request, Client $client)
|
||||
{
|
||||
//may not need these destroy routes as we are using actions to 'archive/delete'
|
||||
$client->delete();
|
||||
|
||||
return response()->json([], 200);
|
||||
$this->client_repo->delete($client);
|
||||
|
||||
return $this->itemResponse($client->fresh());
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -421,7 +421,7 @@ class CompanyGatewayController extends BaseController
|
||||
{
|
||||
$company_gateway->delete();
|
||||
|
||||
return response()->json([], 200);
|
||||
return $this->itemResponse($company_gateway->fresh());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -420,9 +420,9 @@ class CreditController extends BaseController
|
||||
*/
|
||||
public function destroy(DestroyCreditRequest $request, Credit $credit)
|
||||
{
|
||||
$credit->delete();
|
||||
$this->credit_repository->delete($credit);
|
||||
|
||||
return response()->json([], 200);
|
||||
return $this->itemResponse($credit->fresh());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -415,7 +415,7 @@ class DesignController extends BaseController
|
||||
$design->delete();
|
||||
$design->save();
|
||||
|
||||
return response()->json([], 200);
|
||||
return $this->itemResponse($design->fresh());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -414,7 +414,7 @@ class GroupSettingController extends BaseController
|
||||
{
|
||||
$group_setting->delete();
|
||||
|
||||
return response()->json([], 200);
|
||||
return $this->itemResponse($group_setting->fresh());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -451,9 +451,9 @@ class InvoiceController extends BaseController
|
||||
*/
|
||||
public function destroy(DestroyInvoiceRequest $request, Invoice $invoice)
|
||||
{
|
||||
$invoice->delete();
|
||||
$this->invoice_repo->delete($invoice);
|
||||
|
||||
return response()->json([], 200);
|
||||
return $this->itemResponse($invoice->fresh());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -397,7 +397,7 @@ class PaymentTermController extends BaseController
|
||||
{
|
||||
$payment_term->delete();
|
||||
|
||||
return response()->json([], 200);
|
||||
return $this->itemResponse($payment_term->fresh());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -429,7 +429,7 @@ class ProjectController extends BaseController
|
||||
$project->delete();
|
||||
$project->save();
|
||||
|
||||
return response()->json([], 200);
|
||||
return $this->itemResponse($project->fresh());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -441,9 +441,9 @@ class QuoteController extends BaseController
|
||||
*/
|
||||
public function destroy(DestroyQuoteRequest $request, Quote $quote)
|
||||
{
|
||||
$quote->delete();
|
||||
$this->quote_repo->delete($quote);
|
||||
|
||||
return response()->json([], 200);
|
||||
return $this->itemResponse($quote->fresh());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -426,9 +426,9 @@ class RecurringInvoiceController extends BaseController
|
||||
*/
|
||||
public function destroy(DestroyRecurringInvoiceRequest $request, RecurringInvoice $recurring_invoice)
|
||||
{
|
||||
$recurring_invoice->delete();
|
||||
$this->recurring_invoice_repo->delete($recurring_invoice);
|
||||
|
||||
return response()->json([], 200);
|
||||
return $this->itemResponse($recurring_invoice->fresh());
|
||||
}
|
||||
|
||||
|
||||
|
@ -428,9 +428,9 @@ class RecurringQuoteController extends BaseController
|
||||
*/
|
||||
public function destroy(DestroyRecurringQuoteRequest $request, RecurringQuote $recurring_quote)
|
||||
{
|
||||
$recurring_quote->delete();
|
||||
$this->recurring_quote_repo->delete($recurring_quote);
|
||||
|
||||
return response()->json([], 200);
|
||||
return $this->itemResponse($recurring_quote->fresh());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -425,9 +425,9 @@ class TaskController extends BaseController
|
||||
public function destroy(DestroyTaskRequest $request, Task $task)
|
||||
{
|
||||
//may not need these destroy routes as we are using actions to 'archive/delete'
|
||||
$task->delete();
|
||||
$this->task_repo->delete($task);
|
||||
|
||||
return response()->json([], 200);
|
||||
return $this->itemResponse($task->fresh());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -400,7 +400,7 @@ class TaskStatusController extends BaseController
|
||||
{
|
||||
$task_status->delete();
|
||||
|
||||
return response()->json([], 200);
|
||||
return $this->itemResponse($task_status->fresh());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -432,7 +432,7 @@ class VendorController extends BaseController
|
||||
//may not need these destroy routes as we are using actions to 'archive/delete'
|
||||
$vendor->delete();
|
||||
|
||||
return response()->json([], 200);
|
||||
return $this->itemResponse($vendor->fresh());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -112,6 +112,8 @@ class WebhookHandler implements ShouldQueue
|
||||
RequestOptions::JSON => $data, // or 'json' => [...]
|
||||
]);
|
||||
|
||||
nlog($response);
|
||||
|
||||
if ($response->getStatusCode() == 410 || $response->getStatusCode() == 200) {
|
||||
$subscription->delete();
|
||||
}
|
||||
|
@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class ChangeCustomSurchargeColumnType extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('invoices', function (Blueprint $table) {
|
||||
$table->decimal('custom_surcharge1', 20,6)->change();
|
||||
$table->decimal('custom_surcharge2', 20,6)->change();
|
||||
$table->decimal('custom_surcharge3', 20,6)->change();
|
||||
$table->decimal('custom_surcharge4', 20,6)->change();
|
||||
});
|
||||
|
||||
Schema::table('recurring_invoices', function (Blueprint $table) {
|
||||
$table->decimal('custom_surcharge1', 20,6)->change();
|
||||
$table->decimal('custom_surcharge2', 20,6)->change();
|
||||
$table->decimal('custom_surcharge3', 20,6)->change();
|
||||
$table->decimal('custom_surcharge4', 20,6)->change();
|
||||
});
|
||||
|
||||
|
||||
Schema::table('quotes', function (Blueprint $table) {
|
||||
$table->decimal('custom_surcharge1', 20,6)->change();
|
||||
$table->decimal('custom_surcharge2', 20,6)->change();
|
||||
$table->decimal('custom_surcharge3', 20,6)->change();
|
||||
$table->decimal('custom_surcharge4', 20,6)->change();
|
||||
});
|
||||
|
||||
|
||||
Schema::table('credits', function (Blueprint $table) {
|
||||
$table->decimal('custom_surcharge1', 20,6)->change();
|
||||
$table->decimal('custom_surcharge2', 20,6)->change();
|
||||
$table->decimal('custom_surcharge3', 20,6)->change();
|
||||
$table->decimal('custom_surcharge4', 20,6)->change();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user