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 /// Update a geo point
/// </summary> /// </summary>
/// <param name="updatedGeoPoint">GeoPoint to update</param> /// <param name="updatedGeoPoint">GeoPoint to update</param>
[ProducesResponseType(typeof(GeoPoint), 200)] [ProducesResponseType(typeof(GeoPointDTO), 200)]
[ProducesResponseType(typeof(string), 400)] [ProducesResponseType(typeof(string), 400)]
[ProducesResponseType(typeof(string), 404)] [ProducesResponseType(typeof(string), 404)]
[ProducesResponseType(typeof(string), 500)] [ProducesResponseType(typeof(string), 500)]
@ -219,7 +219,7 @@ namespace ManagerService.Controllers
_myInfoMateDbContext.SaveChanges(); _myInfoMateDbContext.SaveChanges();
return new OkObjectResult(existingGeoPoint); return new OkObjectResult(existingGeoPoint.ToDTO());
} }
catch (ArgumentNullException ex) catch (ArgumentNullException ex)
{ {

View File

@ -128,11 +128,7 @@ namespace ManagerService.Data.SubSection
description = Description, description = Description,
contents = Contents, contents = Contents,
categorieId = CategorieId, categorieId = CategorieId,
geometry = Geometry != null ? new GeometryDTO geometry = Geometry != null ? Geometry.ToDto() : null,
{
type = Geometry.GeometryType,
coordinates = Geometry.Coordinates,
} : null,
polyColor = PolyColor, polyColor = PolyColor,
imageResourceId = ImageResourceId, imageResourceId = ImageResourceId,
imageUrl = ImageUrl, imageUrl = ImageUrl,

View File

@ -156,6 +156,7 @@ namespace ManagerService
var connectionString = Configuration.GetConnectionString("PostgresConnection"); var connectionString = Configuration.GetConnectionString("PostgresConnection");
var dataSourceBuilder = new NpgsqlDataSourceBuilder(connectionString); var dataSourceBuilder = new NpgsqlDataSourceBuilder(connectionString);
dataSourceBuilder.UseNetTopologySuite();
dataSourceBuilder.EnableDynamicJson(); dataSourceBuilder.EnableDynamicJson();
var dataSource = dataSourceBuilder.Build(); var dataSource = dataSourceBuilder.Build();
@ -190,7 +191,7 @@ namespace ManagerService
app.UseCors( app.UseCors(
#if DEBUG #if DEBUG
options => options options => options
.SetIsOriginAllowed(origin => string.IsNullOrEmpty(origin) || origin == "http://localhost:55307") .SetIsOriginAllowed(origin => string.IsNullOrEmpty(origin) || origin == "http://localhost:62080")
.AllowAnyMethod() .AllowAnyMethod()
.AllowAnyHeader() .AllowAnyHeader()
.AllowCredentials() .AllowCredentials()