diff options
| author | Ognjen Cirkovic <ciraboxkg@gmail.com> | 2022-11-28 11:23:53 +0100 | 
|---|---|---|
| committer | Ognjen Cirkovic <ciraboxkg@gmail.com> | 2022-11-28 11:23:53 +0100 | 
| commit | d945204fba909a2dfeb25cae2d320ab6e62eaf51 (patch) | |
| tree | 7189f150b60cbb96c6b83f72d260d7a3ba120ad3 /Backend/Api | |
| parent | ec9fac41c863a0b6c7d83452521f8ce0ead14c30 (diff) | |
Promenjen zahtev za pretragu lokacije na backendu. Omogucena pretraga lokacija na clientu, prikazuje se naziv lokacije.
Diffstat (limited to 'Backend/Api')
| -rw-r--r-- | Backend/Api/Api/Controllers/LocationController.cs | 9 | 
1 files changed, 7 insertions, 2 deletions
diff --git a/Backend/Api/Api/Controllers/LocationController.cs b/Backend/Api/Api/Controllers/LocationController.cs index c9ef9ba..ba9c9a8 100644 --- a/Backend/Api/Api/Controllers/LocationController.cs +++ b/Backend/Api/Api/Controllers/LocationController.cs @@ -51,10 +51,15 @@ namespace Api.Controllers              return BadRequest();          } -        [HttpPost("search")] +        [HttpGet("search")]          [Authorize(Roles = "User")] -        public async Task<ActionResult<List<Location>>> searchLocation(int searchtype ,string? query,Coords? coords) +        public async Task<ActionResult<List<Location>>> searchLocation(int searchtype ,string? query,double? latitude,double? longitude)          { +            Coords coords = new Coords(); +            if (latitude!=null && longitude!=null) { +                coords.latitude = (double)latitude; +                coords.longitude = (double)longitude; +            }              List<Location> ret = new List<Location>();              switch (searchtype)              {  | 
