Correzione struttura modelx abilitare null + update API POST

This commit is contained in:
Samuele Locatelli
2026-04-23 19:15:02 +02:00
parent 226cac656f
commit 760a91b3a3
2 changed files with 6 additions and 6 deletions
+4 -4
View File
@@ -13,13 +13,13 @@ namespace MP.Core.Objects
public DataItemCategory Category { get; set; }
public string Name { get; set; } = "";
public string? Name { get; set; } = "";
public string SubType { get; set; } = "";
public string? SubType { get; set; } = "";
public string Type { get; set; } = "";
public string? Type { get; set; } = "";
public string Units { get; set; } = "";
public string? Units { get; set; } = "";
}
}
+2 -2
View File
@@ -1011,7 +1011,7 @@ namespace MP.IOC.Controllers
/// <param name="id">ID dell'IOB</param>
/// <returns></returns>
[HttpPost("saveDataItems/{id}")]
public async Task<IActionResult> SaveDataItems(string id, [FromBody] string content = "")
public async Task<IActionResult> SaveDataItems(string id, [FromBody] List<MachDataItem> dataList)
{
if (string.IsNullOrEmpty(id)) return BadRequest("Missing ID");
@@ -1021,7 +1021,7 @@ namespace MP.IOC.Controllers
string answ = "";
try
{
bool done = await DService.SaveDataItemsAsync(id, content);
bool done = await DService.SaveDataItemsAsync(id, dataList);
answ = done ? "OK" : "KO";
}
catch (Exception exc)