Fix geopoint doesn't working
This commit is contained in:
parent
94443fa411
commit
98f3606887
@ -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)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -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,
|
||||||
|
|||||||
@ -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()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user