Fix unifi with no type passing and lint

This commit is contained in:
shamoon 2024-06-03 11:06:26 -07:00
parent ec79f3042a
commit 67a9f4983c
3 changed files with 15 additions and 10 deletions

View file

@ -14,13 +14,13 @@ const prefixCacheKey = `${proxyName}__prefix`;
const logger = createLogger(proxyName);
async function getWidget(req) {
const { group, service, type } = req.query;
const { group, service } = req.query;
let widget = null;
if (type === "unifi_console") {
if (group === "unifi_console" && service === "unifi_console") {
// info widget
const index = req.query?.query ? JSON.parse(req.query.query).index : undefined;
widget = await getPrivateWidgetOptions(type, index);
widget = await getPrivateWidgetOptions("unifi_console", index);
if (!widget) {
logger.debug("Error retrieving settings for this Unifi widget");
return null;