mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
remove mimes validation within edocument endpoint, because ParseEDocument handles this + minor code cleanups
This commit is contained in:
parent
9ced189262
commit
3aa17bd6cd
@ -584,6 +584,52 @@ class ExpenseController extends BaseController
|
||||
return $this->itemResponse($expense->fresh());
|
||||
}
|
||||
|
||||
/**
|
||||
* @OA\Post(
|
||||
* path="/api/v1/expenses/edocument",
|
||||
* operationId="edocumentExpense",
|
||||
* tags={"expenses"},
|
||||
* summary="Uploads an electronic document to a expense",
|
||||
* description="Handles the uploading of an electronic document to a expense",
|
||||
* @OA\Parameter(ref="#/components/parameters/X-API-TOKEN"),
|
||||
* @OA\Parameter(ref="#/components/parameters/X-Requested-With"),
|
||||
* @OA\Parameter(ref="#/components/parameters/include"),
|
||||
* @OA\RequestBody(
|
||||
* description="User credentials",
|
||||
* required=true,
|
||||
* @OA\MediaType(
|
||||
* mediaType="multipart/form-data",
|
||||
* @OA\Schema(
|
||||
* type="array",
|
||||
* @OA\Items(
|
||||
* type="string",
|
||||
* format="binary",
|
||||
* description="The files to be uploaded",
|
||||
* ),
|
||||
* )
|
||||
* )
|
||||
* ),
|
||||
* @OA\Response(
|
||||
* response=200,
|
||||
* description="Returns a HTTP status",
|
||||
* @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\Response(
|
||||
* response=422,
|
||||
* description="Validation error",
|
||||
* @OA\JsonContent(ref="#/components/schemas/ValidationError"),
|
||||
*
|
||||
* ),
|
||||
* @OA\Response(
|
||||
* response="default",
|
||||
* response="default",
|
||||
* description="Unexpected Error",
|
||||
* @OA\JsonContent(ref="#/components/schemas/Error"),
|
||||
* ),
|
||||
* )
|
||||
*/
|
||||
public function edocument(EDocumentRequest $request)
|
||||
{
|
||||
$user = auth()->user();
|
||||
|
@ -301,7 +301,7 @@ class PostMarkController extends BaseController
|
||||
$inboundMail = new InboundMail();
|
||||
|
||||
$inboundMail->from = $input["From"] ?? '';
|
||||
$inboundMail->to = $input["To"] ; // usage of data-input, because we need a single email here
|
||||
$inboundMail->to = $input["To"]; // usage of data-input, because we need a single email here
|
||||
$inboundMail->subject = $input["Subject"] ?? '';
|
||||
$inboundMail->body = $input["HtmlBody"] ?? '';
|
||||
$inboundMail->text_body = $input["TextBody"] ?? '';
|
||||
|
@ -25,9 +25,9 @@ class EDocumentRequest extends Request
|
||||
$rules = [];
|
||||
|
||||
if ($this->file('documents') && is_array($this->file('documents'))) {
|
||||
$rules['documents.*'] = 'required|file|max:1000000|mimes:xml';
|
||||
$rules['documents.*'] = 'required|file|max:1000000';
|
||||
} elseif ($this->file('documents')) {
|
||||
$rules['documents'] = 'required|file|max:1000000|mimes:xml';
|
||||
$rules['documents'] = 'required|file|max:1000000';
|
||||
}
|
||||
return $rules;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user