mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-23 20:00:33 -04:00
commit
cc7bcdeb0e
@ -315,7 +315,7 @@ class CreateTestData extends Command
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
||||||
factory(\App\Models\Product::class, 50)->create([
|
factory(\App\Models\Product::class, 15000)->create([
|
||||||
'user_id' => $user->id,
|
'user_id' => $user->id,
|
||||||
'company_id' => $company->id,
|
'company_id' => $company->id,
|
||||||
]);
|
]);
|
||||||
|
@ -424,4 +424,73 @@ class CompanyGatewayController extends BaseController
|
|||||||
|
|
||||||
return response()->json([], 200);
|
return response()->json([], 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Perform bulk actions on the list view
|
||||||
|
*
|
||||||
|
* @param BulkCompanyGatewayRequest $request
|
||||||
|
* @return \Illuminate\Http\Response
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @OA\Post(
|
||||||
|
* path="/api/v1/company_gateways/bulk",
|
||||||
|
* operationId="bulkCompanyGateways",
|
||||||
|
* tags={"company_gateways"},
|
||||||
|
* summary="Performs bulk actions on an array of company_gateways",
|
||||||
|
* description="",
|
||||||
|
* @OA\Parameter(ref="#/components/parameters/X-Api-Secret"),
|
||||||
|
* @OA\Parameter(ref="#/components/parameters/X-Api-Token"),
|
||||||
|
* @OA\Parameter(ref="#/components/parameters/X-Requested-With"),
|
||||||
|
* @OA\Parameter(ref="#/components/parameters/index"),
|
||||||
|
* @OA\RequestBody(
|
||||||
|
* description="Array of company gateway IDs",
|
||||||
|
* required=true,
|
||||||
|
* @OA\MediaType(
|
||||||
|
* mediaType="application/json",
|
||||||
|
* @OA\Schema(
|
||||||
|
* type="array",
|
||||||
|
* @OA\Items(
|
||||||
|
* type="integer",
|
||||||
|
* description="Array of hashed IDs to be bulk 'actioned",
|
||||||
|
* example="[0,1,2,3]",
|
||||||
|
* ),
|
||||||
|
* )
|
||||||
|
* )
|
||||||
|
* ),
|
||||||
|
* @OA\Response(
|
||||||
|
* response=200,
|
||||||
|
* description="The Company Gateways response",
|
||||||
|
* @OA\Header(header="X-API-Version", ref="#/components/headers/X-API-Version"),
|
||||||
|
* @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"),
|
||||||
|
* @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"),
|
||||||
|
* @OA\JsonContent(ref="#/components/schemas/CompanyGateway"),
|
||||||
|
* ),
|
||||||
|
* @OA\Response(
|
||||||
|
* response=422,
|
||||||
|
* description="Validation error",
|
||||||
|
* @OA\JsonContent(ref="#/components/schemas/ValidationError"),
|
||||||
|
* ),
|
||||||
|
* @OA\Response(
|
||||||
|
* response="default",
|
||||||
|
* description="Unexpected Error",
|
||||||
|
* @OA\JsonContent(ref="#/components/schemas/Error"),
|
||||||
|
* ),
|
||||||
|
* )
|
||||||
|
*/
|
||||||
|
public function bulk()
|
||||||
|
{
|
||||||
|
$action = request()->input('action');
|
||||||
|
|
||||||
|
$ids = request()->input('ids');
|
||||||
|
|
||||||
|
$company_gateways = CompanyGateway::withTrashed()->find($this->transformKeys($ids));
|
||||||
|
|
||||||
|
$company_gateways->each(function ($company_gateway, $key) use ($action) {
|
||||||
|
if (auth()->user()->can('edit', $company_gateway)) {
|
||||||
|
$this->company_repo->{$action}($client);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return $this->listResponse(CompanyGateway::withTrashed()->whereIn('id', $this->transformKeys($ids)));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,6 @@
|
|||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use App\Utils\Ninja;
|
use App\Utils\Ninja;
|
||||||
use Codedge\Updater\UpdaterManager;
|
|
||||||
use Composer\Factory;
|
use Composer\Factory;
|
||||||
use Composer\IO\NullIO;
|
use Composer\IO\NullIO;
|
||||||
use Composer\Installer;
|
use Composer\Installer;
|
||||||
|
@ -228,7 +228,6 @@ return [
|
|||||||
'URL' => Illuminate\Support\Facades\URL::class,
|
'URL' => Illuminate\Support\Facades\URL::class,
|
||||||
'Validator' => Illuminate\Support\Facades\Validator::class,
|
'Validator' => Illuminate\Support\Facades\Validator::class,
|
||||||
'View' => Illuminate\Support\Facades\View::class,
|
'View' => Illuminate\Support\Facades\View::class,
|
||||||
'Updater' => Codedge\Updater\UpdaterFacade::class,
|
|
||||||
/*
|
/*
|
||||||
* Dependency Facades
|
* Dependency Facades
|
||||||
*/
|
*/
|
||||||
|
@ -189,5 +189,10 @@ class CountriesSeeder extends Seeder
|
|||||||
}
|
}
|
||||||
$country->save();
|
$country->save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$p = Country::where('country_code', 275)->first();
|
||||||
|
$p->name = 'Palestine';
|
||||||
|
$p->save();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -102,6 +102,8 @@ Route::group(['middleware' => ['api_db', 'token_auth', 'locale'], 'prefix' => 'a
|
|||||||
|
|
||||||
Route::resource('company_gateways', 'CompanyGatewayController');
|
Route::resource('company_gateways', 'CompanyGatewayController');
|
||||||
|
|
||||||
|
Route::post('company_gateways/bulk', 'CompanyGatewayController@bulk')->name('company_gateways.bulk');
|
||||||
|
|
||||||
Route::put('company_users/{user}', 'CompanyUserController@update');
|
Route::put('company_users/{user}', 'CompanyUserController@update');
|
||||||
|
|
||||||
Route::resource('group_settings', 'GroupSettingController');
|
Route::resource('group_settings', 'GroupSettingController');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user