Database Update + Local Storage Start
This commit is contained in:
@@ -1,10 +1,8 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Data.Sqlite;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System.Text.Json;
|
||||
|
||||
using watcher_monitoring.Payloads;
|
||||
using watcher_monitoring.Data;
|
||||
using watcher_monitoring.Models;
|
||||
|
||||
namespace watcher_monitoring.Controllers;
|
||||
|
||||
@@ -55,6 +53,19 @@ public class MonitoringController : Controller
|
||||
_logger.LogError("Invalid hardware configuration");
|
||||
return BadRequest(new { error = "Invalid Hardware Configuration Payload", details = errors });
|
||||
}
|
||||
try
|
||||
{
|
||||
// Find Server in Database
|
||||
Server server = await _context.Servers.FindAsync(dto.Id);
|
||||
|
||||
// Add Hardware Configuration
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex.Message);
|
||||
}
|
||||
|
||||
|
||||
return Ok();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user