diff --git a/src/navigation/admin.js b/src/navigation/admin.js index cb66610f41..8572b396c9 100644 --- a/src/navigation/admin.js +++ b/src/navigation/admin.js @@ -129,5 +129,6 @@ admin.get = function () { return cache.map(item => (Object.assign({}, item))); }); }; +// eslint-disable-next-line @typescript-eslint/no-unsafe-call (0, promisify_1.default)(admin); exports.default = admin; diff --git a/src/navigation/admin.ts b/src/navigation/admin.ts index 34c4d5c499..21048008d8 100644 --- a/src/navigation/admin.ts +++ b/src/navigation/admin.ts @@ -120,10 +120,10 @@ admin.get = async function (): Promise { const ids = await db.getSortedSetRange('navigation:enabled', 0, -1) as string[]; // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call const data = await db.getObjects(ids.map(id => `navigation:enabled:${id}`)) as NavigationItem[]; - cache = data.filter(Boolean).map((item) => { + cache = data.filter(Boolean).map((item: NavigationItem) => { if (item.hasOwnProperty('groups')) { try { - item.groups = JSON.parse(item.groups as string); + item.groups = JSON.parse(item.groups as string) as string[]; } catch (err) { if (err instanceof Error) { winston.error(err.stack); @@ -144,7 +144,7 @@ admin.get = async function (): Promise { return cache.map(item => ({ ...item })); }; +// eslint-disable-next-line @typescript-eslint/no-unsafe-call promisify(admin); -export { }; export default admin;