1818use OCP \AppFramework \Http \Attribute \OpenAPI ;
1919use OCP \AppFramework \Http \DataDownloadResponse ;
2020use OCP \AppFramework \Http \DataResponse ;
21+ use OCP \AppFramework \Http \JSONResponse ;
2122use OCP \AppFramework \Http \RedirectResponse ;
2223use OCP \AppFramework \OCSController ;
2324use OCP \DB \Exception ;
@@ -420,13 +421,13 @@ public function getOutputFile(int $ocpTaskId, int $fileId): DataDownloadResponse
420421 *
421422 * @param int $fileId The input file ID
422423 * @param string $taskTypeId The task type of the operation to perform
423- * @return DataResponse <Http::STATUS_OK, array{version: string, tooltip: string}, array{}>|DataResponse <Http::STATUS_BAD_REQUEST, array{error: string}, array{}>
424+ * @return JSONResponse <Http::STATUS_OK, array{version: string, tooltip: string}, array{}>|JSONResponse <Http::STATUS_BAD_REQUEST, array{error: string}, array{}>
424425 *
425426 * 200: The task has been scheduled successfully
426427 * 400: There was an issue while scheduling the task
427428 */
428429 #[NoAdminRequired]
429- public function runFileAction (int $ fileId , string $ taskTypeId ): DataResponse {
430+ public function runFileAction (int $ fileId , string $ taskTypeId ): JSONResponse {
430431 try {
431432 $ this ->taskProcessingService ->runFileAction ($ this ->userId , $ fileId , $ taskTypeId );
432433 $ message = $ this ->l10n ->t ('Assistant task submitted successfully ' );
@@ -439,12 +440,12 @@ public function runFileAction(int $fileId, string $taskTypeId): DataResponse {
439440 $ message = $ this ->l10n ->t ('Text-to-speech task submitted successfully ' );
440441 }
441442 }
442- return new DataResponse ([
443+ return new JSONResponse ([
443444 'version ' => '0.1 ' ,
444445 'tooltip ' => $ message ,
445446 ]);
446447 } catch (Exception |Throwable $ e ) {
447- return new DataResponse (['error ' => $ e ->getMessage ()], Http::STATUS_BAD_REQUEST );
448+ return new JSONResponse (['error ' => $ e ->getMessage ()], Http::STATUS_BAD_REQUEST );
448449 }
449450 }
450451}
0 commit comments