diff --git a/ManagerService/Controllers/SectionMapController.cs b/ManagerService/Controllers/SectionMapController.cs index 2451320..ec21d26 100644 --- a/ManagerService/Controllers/SectionMapController.cs +++ b/ManagerService/Controllers/SectionMapController.cs @@ -187,7 +187,7 @@ namespace ManagerService.Controllers /// Update a geo point /// /// GeoPoint to update - [ProducesResponseType(typeof(GeoPoint), 200)] + [ProducesResponseType(typeof(GeoPointDTO), 200)] [ProducesResponseType(typeof(string), 400)] [ProducesResponseType(typeof(string), 404)] [ProducesResponseType(typeof(string), 500)] @@ -219,7 +219,7 @@ namespace ManagerService.Controllers _myInfoMateDbContext.SaveChanges(); - return new OkObjectResult(existingGeoPoint); + return new OkObjectResult(existingGeoPoint.ToDTO()); } catch (ArgumentNullException ex) { diff --git a/ManagerService/Data/SubSection/SectionMap.cs b/ManagerService/Data/SubSection/SectionMap.cs index 5372f9d..f485c95 100644 --- a/ManagerService/Data/SubSection/SectionMap.cs +++ b/ManagerService/Data/SubSection/SectionMap.cs @@ -128,11 +128,7 @@ namespace ManagerService.Data.SubSection description = Description, contents = Contents, categorieId = CategorieId, - geometry = Geometry != null ? new GeometryDTO - { - type = Geometry.GeometryType, - coordinates = Geometry.Coordinates, - } : null, + geometry = Geometry != null ? Geometry.ToDto() : null, polyColor = PolyColor, imageResourceId = ImageResourceId, imageUrl = ImageUrl, diff --git a/ManagerService/Startup.cs b/ManagerService/Startup.cs index 61eb8cf..f66f9b1 100644 --- a/ManagerService/Startup.cs +++ b/ManagerService/Startup.cs @@ -156,6 +156,7 @@ namespace ManagerService var connectionString = Configuration.GetConnectionString("PostgresConnection"); var dataSourceBuilder = new NpgsqlDataSourceBuilder(connectionString); + dataSourceBuilder.UseNetTopologySuite(); dataSourceBuilder.EnableDynamicJson(); var dataSource = dataSourceBuilder.Build(); @@ -190,7 +191,7 @@ namespace ManagerService app.UseCors( #if DEBUG options => options - .SetIsOriginAllowed(origin => string.IsNullOrEmpty(origin) || origin == "http://localhost:55307") + .SetIsOriginAllowed(origin => string.IsNullOrEmpty(origin) || origin == "http://localhost:62080") .AllowAnyMethod() .AllowAnyHeader() .AllowCredentials()