mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-23 20:00:33 -04:00
Fixes for Swagger + Group Settings Documents
This commit is contained in:
parent
0c23c058c5
commit
86d4f5e7ea
@ -18,6 +18,8 @@ use App\Http\Requests\GroupSetting\EditGroupSettingRequest;
|
|||||||
use App\Http\Requests\GroupSetting\ShowGroupSettingRequest;
|
use App\Http\Requests\GroupSetting\ShowGroupSettingRequest;
|
||||||
use App\Http\Requests\GroupSetting\StoreGroupSettingRequest;
|
use App\Http\Requests\GroupSetting\StoreGroupSettingRequest;
|
||||||
use App\Http\Requests\GroupSetting\UpdateGroupSettingRequest;
|
use App\Http\Requests\GroupSetting\UpdateGroupSettingRequest;
|
||||||
|
use App\Http\Requests\GroupSetting\UploadGroupSettingRequest;
|
||||||
|
use App\Models\Account;
|
||||||
use App\Models\GroupSetting;
|
use App\Models\GroupSetting;
|
||||||
use App\Repositories\GroupSettingRepository;
|
use App\Repositories\GroupSettingRepository;
|
||||||
use App\Transformers\GroupSettingTransformer;
|
use App\Transformers\GroupSettingTransformer;
|
||||||
@ -497,4 +499,68 @@ class GroupSettingController extends BaseController
|
|||||||
|
|
||||||
return $this->listResponse(GroupSetting::withTrashed()->whereIn('id', $this->transformKeys($ids))->company());
|
return $this->listResponse(GroupSetting::withTrashed()->whereIn('id', $this->transformKeys($ids))->company());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update the specified resource in storage.
|
||||||
|
*
|
||||||
|
* @param UploadGroupSettingRequest $request
|
||||||
|
* @param GroupSetting $group_setting
|
||||||
|
* @return Response
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @OA\Put(
|
||||||
|
* path="/api/v1/group_settings/{id}/upload",
|
||||||
|
* operationId="uploadGroupSetting",
|
||||||
|
* tags={"group_settings"},
|
||||||
|
* summary="Uploads a document to a group setting",
|
||||||
|
* description="Handles the uploading of a document to a group setting",
|
||||||
|
* @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/include"),
|
||||||
|
* @OA\Parameter(
|
||||||
|
* name="id",
|
||||||
|
* in="path",
|
||||||
|
* description="The Group Setting Hashed ID",
|
||||||
|
* example="D2J234DFA",
|
||||||
|
* required=true,
|
||||||
|
* @OA\Schema(
|
||||||
|
* type="string",
|
||||||
|
* format="string",
|
||||||
|
* ),
|
||||||
|
* ),
|
||||||
|
* @OA\Response(
|
||||||
|
* response=200,
|
||||||
|
* description="Returns the Group Setting object",
|
||||||
|
* @OA\Header(header="X-MINIMUM-CLIENT-VERSION", ref="#/components/headers/X-MINIMUM-CLIENT-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/Invoice"),
|
||||||
|
* ),
|
||||||
|
* @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 upload(UploadGroupSettingRequest $request, GroupSetting $group_setting)
|
||||||
|
{
|
||||||
|
if(!$this->checkFeature(Account::FEATURE_DOCUMENTS))
|
||||||
|
return $this->featureFailure();
|
||||||
|
|
||||||
|
if ($request->has('documents'))
|
||||||
|
$this->saveDocuments($request->file('documents'), $group_setting);
|
||||||
|
|
||||||
|
return $this->itemResponse($group_setting->fresh());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -10,8 +10,8 @@
|
|||||||
* email="contact@invoiceninja.com"
|
* email="contact@invoiceninja.com"
|
||||||
* ),
|
* ),
|
||||||
* @OA\License(
|
* @OA\License(
|
||||||
* name="Attribution Assurance License",
|
* name="Elastic License",
|
||||||
* url="https://opensource.org/licenses/AAL"
|
* url="https://www.elastic.co/licensing/elastic-license"
|
||||||
* ),
|
* ),
|
||||||
* ),
|
* ),
|
||||||
* @OA\Server(
|
* @OA\Server(
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
"tasks",
|
"tasks",
|
||||||
"freelancer"
|
"freelancer"
|
||||||
],
|
],
|
||||||
"license": "Attribution Assurance License",
|
"license": "Elastic License",
|
||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "Hillel Coren",
|
"name": "Hillel Coren",
|
||||||
|
@ -88,11 +88,7 @@ class SquareCreditCard {
|
|||||||
}
|
}
|
||||||
catch(typeError){
|
catch(typeError){
|
||||||
console.log(typeError);
|
console.log(typeError);
|
||||||
die("failed in the catch");
|
|
||||||
}
|
}
|
||||||
// console.log(" verification tokem = " + verificationToken.token);
|
|
||||||
|
|
||||||
// verificationToken = verificationResults.token;
|
|
||||||
|
|
||||||
console.debug('Verification Token:', verificationToken);
|
console.debug('Verification Token:', verificationToken);
|
||||||
|
|
||||||
|
@ -86,6 +86,7 @@ Route::group(['middleware' => ['api_db', 'token_auth', 'locale'], 'prefix' => 'a
|
|||||||
|
|
||||||
Route::resource('group_settings', 'GroupSettingController');
|
Route::resource('group_settings', 'GroupSettingController');
|
||||||
Route::post('group_settings/bulk', 'GroupSettingController@bulk');
|
Route::post('group_settings/bulk', 'GroupSettingController@bulk');
|
||||||
|
Route::put('group_settings/{group_setting}/upload', 'GroupSettingController@upload')->name('group_settings.upload');
|
||||||
|
|
||||||
Route::post('import', 'ImportController@import')->name('import.import');
|
Route::post('import', 'ImportController@import')->name('import.import');
|
||||||
Route::post('import_json', 'ImportJsonController@import')->name('import.import_json');
|
Route::post('import_json', 'ImportJsonController@import')->name('import.import_json');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user