Skip to content

Commit

Permalink
🔥 refactor(TextToSpeechController.php): remove unused import statemen…
Browse files Browse the repository at this point in the history
…t for Symfony\Component\ErrorHandler\Debug

🔥 refactor(TextToSpeechController.php): remove unused parameter $icao from index() method
🔥 refactor(TextToSpeechController.php): remove unused parameter $icao from generate() method
🔧 chore(TextToSpeechController.php): update file deletion logic in delete() method to use Storage::delete() instead of Storage::disk('local')->delete() for better code readability and consistency
  • Loading branch information
Vahn Gomes authored and Vahn Gomes committed Jul 21, 2023
1 parent f319262 commit bd3edde
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/app/Http/Controllers/API/TextToSpeechController.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Storage;
use Symfony\Component\ErrorHandler\Debug;
use Vyuldashev\LaravelOpenApi\Attributes as OpenApi;

#[OpenApi\PathItem]
Expand Down Expand Up @@ -89,7 +88,6 @@ public function index(Request $request): JsonResponse
*
* Generates a mp3 text-to-speech file for an airport and returns a link to it.
*
* @param string $icao The ICAO code of the airport to generate the TTS for.
* @param Request $request
* @return JsonResponse
*/
Expand Down Expand Up @@ -245,7 +243,6 @@ public function generate(Request $request): JsonResponse
*
* Deletes a mp3 text-to-speech file for an airport.
*
* @param string $icao The ICAO code of the airport to generate the TTS for.
* @param Request $request
* @return JsonResponse
*/
Expand Down Expand Up @@ -298,7 +295,7 @@ public function delete(Request $request): JsonResponse
}

// Delete the file from the server
Storage::disk('local')->delete("public/atis/$id/$atis_file->file_name");
Storage::delete('public/atis/' . $id . '/' . $atis_file->file_name);

// Delete the database entry
$atis_file->delete();
Expand Down

0 comments on commit bd3edde

Please sign in to comment.