mirror of
https://github.com/9technologygroup/patchmon.net.git
synced 2026-01-10 15:09:46 -06:00
Fix #402 - relating to Accepting the WhatsNew messages
This commit is contained in:
@@ -847,12 +847,10 @@ router.post(
|
||||
// Get accepted release notes versions
|
||||
let acceptedVersions = [];
|
||||
try {
|
||||
if (prisma.release_notes_acceptances) {
|
||||
acceptedVersions = await prisma.release_notes_acceptances.findMany({
|
||||
where: { user_id: user.id },
|
||||
select: { version: true },
|
||||
});
|
||||
}
|
||||
acceptedVersions = await prisma.release_notes_acceptances.findMany({
|
||||
where: { user_id: user.id },
|
||||
select: { version: true },
|
||||
});
|
||||
} catch (error) {
|
||||
// If table doesn't exist yet or Prisma client not regenerated, use empty array
|
||||
console.warn(
|
||||
@@ -1010,12 +1008,10 @@ router.post(
|
||||
// Get accepted release notes versions
|
||||
let acceptedVersions = [];
|
||||
try {
|
||||
if (prisma.release_notes_acceptances) {
|
||||
acceptedVersions = await prisma.release_notes_acceptances.findMany({
|
||||
where: { user_id: user.id },
|
||||
select: { version: true },
|
||||
});
|
||||
}
|
||||
acceptedVersions = await prisma.release_notes_acceptances.findMany({
|
||||
where: { user_id: user.id },
|
||||
select: { version: true },
|
||||
});
|
||||
} catch (error) {
|
||||
// If table doesn't exist yet or Prisma client not regenerated, use empty array
|
||||
console.warn(
|
||||
|
||||
@@ -625,7 +625,14 @@ router.post(
|
||||
if (req.body.diskDetails) updateData.disk_details = req.body.diskDetails;
|
||||
|
||||
// Network Information
|
||||
if (req.body.gatewayIp) updateData.gateway_ip = req.body.gatewayIp;
|
||||
if (req.body.gatewayIp) {
|
||||
updateData.gateway_ip = req.body.gatewayIp;
|
||||
} else if (Object.hasOwn(req.body, "gatewayIp")) {
|
||||
// Log warning if gateway field was sent but empty (isolated network)
|
||||
console.warn(
|
||||
`Host ${host.hostname} reported with no default gateway configured`,
|
||||
);
|
||||
}
|
||||
if (req.body.dnsServers) updateData.dns_servers = req.body.dnsServers;
|
||||
if (req.body.networkInterfaces)
|
||||
updateData.network_interfaces = req.body.networkInterfaces;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"$schema": "https://biomejs.dev/schemas/2.3.4/schema.json",
|
||||
"$schema": "https://biomejs.dev/schemas/2.3.11/schema.json",
|
||||
"vcs": {
|
||||
"enabled": true,
|
||||
"clientKind": "git",
|
||||
|
||||
Reference in New Issue
Block a user