refactored system settings

This commit is contained in:
2025-09-12 13:28:14 +01:00
parent d03f73f751
commit 7588326cbe
19 changed files with 363 additions and 232 deletions

View File

@@ -1,17 +1,17 @@
export async function handleSystemSave(
deviceName: string,
sntpServer: string,
sntpInterval: number,
timeZone: string
) {
import type { SystemValues } from "../../../types/types";
export async function handleSystemSave(values: SystemValues) {
const payload = {
// Build JSON
id: "GLOBAL--Device",
fields: [
{ property: "propDeviceName", value: deviceName },
{ property: "propSNTPServer", value: sntpServer },
{ property: "propSNTPIntervalMinutes", value: Number(sntpInterval) },
{ property: "propLocalTimeZone", value: timeZone },
{ property: "propDeviceName", value: values.deviceName },
{ property: "propSNTPServer", value: values.sntpServer },
{
property: "propSNTPIntervalMinutes",
value: Number(values.sntpInterval),
},
{ property: "propLocalTimeZone", value: values.timeZone },
],
};