mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-08 08:12:17 +01:00
added importer to organization settings
This commit is contained in:
@@ -17,16 +17,25 @@ class ImportController extends Controller
|
||||
* Import data into the organization
|
||||
*
|
||||
* @throws AuthorizationException
|
||||
*
|
||||
* @operationId importData
|
||||
*/
|
||||
public function import(Organization $organization, ImportRequest $request, ImportService $importService): JsonResponse
|
||||
{
|
||||
$this->checkPermission($organization, 'import');
|
||||
|
||||
try {
|
||||
$importData = base64_decode($request->input('data'), true);
|
||||
if ($importData === false) {
|
||||
return new JsonResponse([
|
||||
'message' => 'Invalid base64 encoded data',
|
||||
], 400);
|
||||
}
|
||||
|
||||
$report = $importService->import(
|
||||
$organization,
|
||||
$request->input('type'),
|
||||
$request->input('data')
|
||||
$importData
|
||||
);
|
||||
|
||||
return new JsonResponse([
|
||||
|
||||
Reference in New Issue
Block a user