mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-07 17:44:29 -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();
|
parent::__construct();
|
||||||
|
|
||||||
|
$this->middleware('password_protected', ['only' => ['destroy']]);
|
||||||
|
|
||||||
$this->document_repo = $document_repo;
|
$this->document_repo = $document_repo;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -117,6 +119,7 @@ class DocumentController extends BaseController
|
|||||||
*/
|
*/
|
||||||
public function destroy(DestroyDocumentRequest $request, Document $document)
|
public function destroy(DestroyDocumentRequest $request, Document $document)
|
||||||
{
|
{
|
||||||
|
|
||||||
$this->document_repo->delete($document);
|
$this->document_repo->delete($document);
|
||||||
|
|
||||||
return response()->json(['message'=>'success']);
|
return response()->json(['message'=>'success']);
|
||||||
|
@ -50,8 +50,8 @@ class QueryLogging
|
|||||||
|
|
||||||
Log::info($request->method() . ' - ' . $request->url() . ": $count queries - " . $time);
|
Log::info($request->method() . ' - ' . $request->url() . ": $count queries - " . $time);
|
||||||
|
|
||||||
// if($count > 700)
|
// if($count > 100)
|
||||||
// Log::info($queries);
|
// Log::info($queries);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -64,12 +64,12 @@ class ActivityRepository extends BaseRepository
|
|||||||
{
|
{
|
||||||
$backup = new Backup();
|
$backup = new Backup();
|
||||||
|
|
||||||
if (get_class($entity) == Client::class) {
|
// if (get_class($entity) == Client::class) {
|
||||||
$entity->load('company');
|
// $entity->load('company');
|
||||||
} elseif (get_class($entity) == User::class) {
|
// } elseif (get_class($entity) == User::class) {
|
||||||
} else {
|
// } else {
|
||||||
$entity->load('company', 'client');
|
// $entity->load('company', 'client');
|
||||||
}
|
// }
|
||||||
|
|
||||||
$backup->html_backup = $this->generateEntityHtml($entity->getEntityDesigner(), $entity);
|
$backup->html_backup = $this->generateEntityHtml($entity->getEntityDesigner(), $entity);
|
||||||
$backup->activity_id = $activity->id;
|
$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 */
|
/* 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){
|
$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_class = sprintf("App\\Models\\%sInvitation", $resource);
|
||||||
$invitation = $invitation_class::whereRaw("BINARY `key`= ?", [$invitation])->first();
|
$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/{company}', 'MigrationController@purgeCompany')->middleware('password_protected');
|
||||||
Route::post('migration/purge_save_settings/{company}', 'MigrationController@purgeCompanySaveSettings')->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::post('migration/start/{company}', 'MigrationController@startMigration');
|
||||||
|
|
||||||
Route::resource('companies', 'CompanyController');// name = (companies. index / create / show / update / destroy / edit
|
Route::resource('companies', 'CompanyController');// name = (companies. index / create / show / update / destroy / edit
|
||||||
|
Loading…
x
Reference in New Issue
Block a user