Fix geopoint doesn't working

This commit is contained in:
Thomas Fransolet 2025-11-27 16:52:10 +01:00
parent 94443fa411
commit 98f3606887
3 changed files with 5 additions and 8 deletions

View File

@ -187,7 +187,7 @@ namespace ManagerService.Controllers
/// Update a geo point
/// </summary>
/// <param name="updatedGeoPoint">GeoPoint to update</param>
[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)
{

View File

@ -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,

View File

@ -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()