Skip to content

Commit

Permalink
Use StreamedJsonRespone to avoid linting error
Browse files Browse the repository at this point in the history
  • Loading branch information
lehecht committed Nov 13, 2024
1 parent f040bdf commit 6199857
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion app/Http/Controllers/Api/ImageAnnotationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use Generator;
use Illuminate\Http\Request;
use Illuminate\Validation\ValidationException;
use Symfony\Component\HttpFoundation\StreamedJsonResponse;

class ImageAnnotationController extends Controller
{
Expand Down Expand Up @@ -90,7 +91,7 @@ public function index(Request $request, $id)
};
}

return response()->streamJson(iterator_to_array($yieldAnnotations()));
return new StreamedJsonResponse($yieldAnnotations());
}

/**
Expand Down
3 changes: 2 additions & 1 deletion app/Http/Controllers/Api/VideoAnnotationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use Illuminate\Http\Request;
use Illuminate\Validation\ValidationException;
use Queue;
use Symfony\Component\HttpFoundation\StreamedJsonResponse;
use Symfony\Component\HttpKernel\Exception\TooManyRequestsHttpException;

class VideoAnnotationController extends Controller
Expand Down Expand Up @@ -84,7 +85,7 @@ public function index(Request $request, $id)
};
}

return response()->streamJson(iterator_to_array($yieldAnnotations()));
return new StreamedJsonResponse($yieldAnnotations());
}

/**
Expand Down

0 comments on commit 6199857

Please sign in to comment.