From 72d8327b6fba1c75fa3599c3f4acecaec2566a04 Mon Sep 17 00:00:00 2001 From: andresvcc <43545168+andresvcc@users.noreply.github.com> Date: Fri, 3 May 2024 10:07:14 +0200 Subject: [PATCH] refactor(openwrt-config-dashboard): unused modules within JSON-RPC http calls were removed each of the imports into the functions that make the different JSON-RPC calls, (the ones that represent the communication with the router) were removed to clean up the code and improve readability. --- .../useLuciRCPjsonClient/fetchCalls/getAllDevicesIP:Name.ts | 5 ----- .../src/hooks/useLuciRCPjsonClient/fetchCalls/getIfstatus.ts | 3 --- .../src/hooks/useLuciRCPjsonClient/fetchCalls/getUptime.ts | 3 --- .../hooks/useLuciRCPjsonClient/fetchCalls/getWifiStatus.ts | 3 --- .../useLuciRCPjsonClient/fetchCalls/updateRootPassword.ts | 4 ---- 5 files changed, 18 deletions(-) diff --git a/apps/openwrt-config-dashboard/src/hooks/useLuciRCPjsonClient/fetchCalls/getAllDevicesIP:Name.ts b/apps/openwrt-config-dashboard/src/hooks/useLuciRCPjsonClient/fetchCalls/getAllDevicesIP:Name.ts index 034322e..408239f 100644 --- a/apps/openwrt-config-dashboard/src/hooks/useLuciRCPjsonClient/fetchCalls/getAllDevicesIP:Name.ts +++ b/apps/openwrt-config-dashboard/src/hooks/useLuciRCPjsonClient/fetchCalls/getAllDevicesIP:Name.ts @@ -1,8 +1,3 @@ -import { LoginTokenResponse } from '@/types'; -import axios, { AxiosRequestConfig, AxiosResponse } from 'axios'; -import { act } from 'react-test-renderer'; -import tough, { Cookie } from 'tough-cookie'; -import { t } from 'xstate'; import { Sid } from '..'; function matchesThymioPattern(str: string): boolean { diff --git a/apps/openwrt-config-dashboard/src/hooks/useLuciRCPjsonClient/fetchCalls/getIfstatus.ts b/apps/openwrt-config-dashboard/src/hooks/useLuciRCPjsonClient/fetchCalls/getIfstatus.ts index 5664ae8..21dbf4e 100644 --- a/apps/openwrt-config-dashboard/src/hooks/useLuciRCPjsonClient/fetchCalls/getIfstatus.ts +++ b/apps/openwrt-config-dashboard/src/hooks/useLuciRCPjsonClient/fetchCalls/getIfstatus.ts @@ -1,6 +1,3 @@ -import { LoginTokenResponse } from '@/types'; -import axios, { AxiosRequestConfig, AxiosResponse } from 'axios'; -import tough, { Cookie } from 'tough-cookie'; import { Sid } from '..'; export async function getIfStatus({ sid }: { sid: Sid }): Promise { diff --git a/apps/openwrt-config-dashboard/src/hooks/useLuciRCPjsonClient/fetchCalls/getUptime.ts b/apps/openwrt-config-dashboard/src/hooks/useLuciRCPjsonClient/fetchCalls/getUptime.ts index df2d2fd..ec620b2 100644 --- a/apps/openwrt-config-dashboard/src/hooks/useLuciRCPjsonClient/fetchCalls/getUptime.ts +++ b/apps/openwrt-config-dashboard/src/hooks/useLuciRCPjsonClient/fetchCalls/getUptime.ts @@ -1,6 +1,3 @@ -import { LoginTokenResponse } from '@/types'; -import axios, { AxiosRequestConfig, AxiosResponse } from 'axios'; -import tough, { Cookie } from 'tough-cookie'; import { Sid } from '..'; export async function getUptime({ sid }: { sid: Sid }): Promise { diff --git a/apps/openwrt-config-dashboard/src/hooks/useLuciRCPjsonClient/fetchCalls/getWifiStatus.ts b/apps/openwrt-config-dashboard/src/hooks/useLuciRCPjsonClient/fetchCalls/getWifiStatus.ts index 8708988..a639906 100644 --- a/apps/openwrt-config-dashboard/src/hooks/useLuciRCPjsonClient/fetchCalls/getWifiStatus.ts +++ b/apps/openwrt-config-dashboard/src/hooks/useLuciRCPjsonClient/fetchCalls/getWifiStatus.ts @@ -1,6 +1,3 @@ -import { LoginTokenResponse } from '@/types'; -import axios, { AxiosRequestConfig, AxiosResponse } from 'axios'; -import tough, { Cookie } from 'tough-cookie'; import { Sid } from '..'; function parseStringToJson(inputString: string): any { diff --git a/apps/openwrt-config-dashboard/src/hooks/useLuciRCPjsonClient/fetchCalls/updateRootPassword.ts b/apps/openwrt-config-dashboard/src/hooks/useLuciRCPjsonClient/fetchCalls/updateRootPassword.ts index 708408e..60195d9 100644 --- a/apps/openwrt-config-dashboard/src/hooks/useLuciRCPjsonClient/fetchCalls/updateRootPassword.ts +++ b/apps/openwrt-config-dashboard/src/hooks/useLuciRCPjsonClient/fetchCalls/updateRootPassword.ts @@ -1,7 +1,3 @@ -import { LoginTokenResponse } from '@/types'; -import axios, { AxiosRequestConfig, AxiosResponse } from 'axios'; -import tough, { Cookie } from 'tough-cookie'; - export async function updateRootPassword({ newPassword, sidToken,