mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Add middleware to destroy document
This commit is contained in:
parent
e8b3390c4b
commit
c195f5b8a5
@ -34,6 +34,8 @@ class DocumentController extends BaseController
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->middleware('password_protected', ['only' => ['destroy']]);
|
||||
|
||||
$this->document_repo = $document_repo;
|
||||
}
|
||||
|
||||
@ -117,6 +119,7 @@ class DocumentController extends BaseController
|
||||
*/
|
||||
public function destroy(DestroyDocumentRequest $request, Document $document)
|
||||
{
|
||||
|
||||
$this->document_repo->delete($document);
|
||||
|
||||
return response()->json(['message'=>'success']);
|
||||
|
@ -50,8 +50,8 @@ class QueryLogging
|
||||
|
||||
Log::info($request->method() . ' - ' . $request->url() . ": $count queries - " . $time);
|
||||
|
||||
// if($count > 700)
|
||||
// Log::info($queries);
|
||||
// if($count > 100)
|
||||
// Log::info($queries);
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -64,12 +64,12 @@ class ActivityRepository extends BaseRepository
|
||||
{
|
||||
$backup = new Backup();
|
||||
|
||||
if (get_class($entity) == Client::class) {
|
||||
$entity->load('company');
|
||||
} elseif (get_class($entity) == User::class) {
|
||||
} else {
|
||||
$entity->load('company', 'client');
|
||||
}
|
||||
// if (get_class($entity) == Client::class) {
|
||||
// $entity->load('company');
|
||||
// } elseif (get_class($entity) == User::class) {
|
||||
// } else {
|
||||
// $entity->load('company', 'client');
|
||||
// }
|
||||
|
||||
$backup->html_backup = $this->generateEntityHtml($entity->getEntityDesigner(), $entity);
|
||||
$backup->activity_id = $activity->id;
|
||||
|
@ -252,7 +252,6 @@ class BaseRepository
|
||||
|
||||
/* Get array of Keys which have been removed from the invitations array and soft delete each invitation */
|
||||
$model->invitations->pluck('key')->diff($invitations->pluck('key'))->each(function ($invitation) use($resource){
|
||||
// $this->getInvitation($invitation, $resource)->delete();
|
||||
|
||||
$invitation_class = sprintf("App\\Models\\%sInvitation", $resource);
|
||||
$invitation = $invitation_class::whereRaw("BINARY `key`= ?", [$invitation])->first();
|
||||
|
@ -102,6 +102,9 @@ Route::group(['middleware' => ['api_db', 'token_auth', 'locale'], 'prefix' => 'a
|
||||
|
||||
Route::post('migration/purge/{company}', 'MigrationController@purgeCompany')->middleware('password_protected');
|
||||
Route::post('migration/purge_save_settings/{company}', 'MigrationController@purgeCompanySaveSettings')->middleware('password_protected');
|
||||
Route::post('companies/purge/{company}', 'MigrationController@purgeCompany')->middleware('password_protected');
|
||||
Route::post('companies/purge_save_settings/{company}', 'MigrationController@purgeCompanySaveSettings')->middleware('password_protected');
|
||||
|
||||
Route::post('migration/start/{company}', 'MigrationController@startMigration');
|
||||
|
||||
Route::resource('companies', 'CompanyController');// name = (companies. index / create / show / update / destroy / edit
|
||||
|
Loading…
x
Reference in New Issue
Block a user