diff options
| author | Ariel Costas Guerrero <94913521+arielcostas@users.noreply.github.com> | 2024-09-09 18:48:45 +0200 |
|---|---|---|
| committer | Ariel Costas Guerrero <94913521+arielcostas@users.noreply.github.com> | 2024-09-09 18:48:57 +0200 |
| commit | 9925249bf489ae960189f6daabe59263d1620c89 (patch) | |
| tree | da04f135ee1e724491c7cc1c5d128f285a83713e /Backend/ListStops.cs | |
| parent | 663a2a3ff10bf55498a6c8731b1a32e9f98d7343 (diff) | |
Favourite stops, local stop list
Diffstat (limited to 'Backend/ListStops.cs')
| -rw-r--r-- | Backend/ListStops.cs | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/Backend/ListStops.cs b/Backend/ListStops.cs deleted file mode 100644 index b6f9ab4..0000000 --- a/Backend/ListStops.cs +++ /dev/null @@ -1,39 +0,0 @@ -using Microsoft.Azure.Functions.Worker; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Costasdev.VigoTransitApi; -using Costasdev.VigoTransitApi.Types; - -namespace Costasdev.UrbanoVigoWeb; - -public class ListStops -{ - private readonly VigoTransitApiClient _api; - - public List<Stop>? Stops { get; set; } = null; - - public ListStops(HttpClient http) - { - _api = new VigoTransitApiClient(http); - } - - [Function("ListStops")] - public async Task<IActionResult> Run([HttpTrigger(AuthorizationLevel.Anonymous, "get")] HttpRequest req) - { - // Get stops from cache - if (Stops != null) - { - return new OkObjectResult(Stops); - } - - try - { - var stops = await _api.GetStops(); - return new OkObjectResult(stops); - } - catch (InvalidOperationException) - { - return new BadRequestObjectResult("Stop not found"); - } - } -} |
