Refactor type usage and improve data normalization
Updated several components to use explicit TypeScript types for better type safety. Normalized appriseUrls to always be an array in auto-sync settings API. Improved handling of optional server_id in BackupsTab and adjusted IP detection logic in InstalledScriptsTab. Removed unnecessary eslint-disable comments and improved code clarity in various places.
This commit is contained in:
@@ -476,7 +476,8 @@ export const installedScriptsRouter = createTRPCRouter({
|
||||
const scripts = await db.getAllInstalledScripts();
|
||||
|
||||
// Transform scripts to flatten server data for frontend compatibility
|
||||
const transformedScripts = await Promise.all(scripts.map(async (script) => {
|
||||
|
||||
const transformedScripts = await Promise.all(scripts.map(async (script: any) => {
|
||||
// Determine if it's a VM or LXC
|
||||
let is_vm = false;
|
||||
if (script.container_id && script.server_id) {
|
||||
@@ -522,7 +523,8 @@ export const installedScriptsRouter = createTRPCRouter({
|
||||
const scripts = await db.getInstalledScriptsByServer(input.serverId);
|
||||
|
||||
// Transform scripts to flatten server data for frontend compatibility
|
||||
const transformedScripts = await Promise.all(scripts.map(async (script) => {
|
||||
|
||||
const transformedScripts = await Promise.all(scripts.map(async (script: any) => {
|
||||
// Determine if it's a VM or LXC
|
||||
let is_vm = false;
|
||||
if (script.container_id && script.server_id) {
|
||||
|
||||
Reference in New Issue
Block a user