/** * Handles POST action * * @return \DreamFactory\Core\Contracts\ServiceResponseInterface|\DreamFactory\Core\Utility\ServiceResponse|mixed * @throws \DreamFactory\Core\Exceptions\BadRequestException * @throws \Exception */ protected function handlePOST() { $uploadedFiles = $this->request->getFile('file'); $importUrl = $this->request->getPayloadData('import_url'); $storageServiceId = $this->request->input('storage_service_id'); $storageContainer = $this->request->input('storage_container'); if (!empty($uploadedFiles)) { $package = new Packager($uploadedFiles); $results = $package->importAppFromPackage($storageServiceId, $storageContainer); } elseif (!empty($importUrl)) { $package = new Packager($importUrl); $results = $package->importAppFromPackage($storageServiceId, $storageContainer); } else { $results = parent::handlePOST(); } return $results; }
/** * {@inheritdoc} */ protected function handlePOST() { return $this->handleInvitation(parent::handlePOST()); }