Fix #402 - relating to Accepting the WhatsNew messages

This commit is contained in:
Muhammad Ibrahim
2026-01-04 16:03:24 +00:00
parent 01693d7e34
commit e269c12463
3 changed files with 17 additions and 14 deletions

View File

@@ -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(

View File

@@ -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;

View File

@@ -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",