From 9925249bf489ae960189f6daabe59263d1620c89 Mon Sep 17 00:00:00 2001 From: Ariel Costas Guerrero <94913521+arielcostas@users.noreply.github.com> Date: Mon, 9 Sep 2024 18:48:45 +0200 Subject: Favourite stops, local stop list --- Backend/ListStops.cs | 39 --------------------------------------- 1 file changed, 39 deletions(-) delete mode 100644 Backend/ListStops.cs (limited to 'Backend/ListStops.cs') 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? Stops { get; set; } = null; - - public ListStops(HttpClient http) - { - _api = new VigoTransitApiClient(http); - } - - [Function("ListStops")] - public async Task 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"); - } - } -} -- cgit v1.3