From 5474fe324fc5592c75e13a6efdfcca09648cfe23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Darveau?= Date: Tue, 7 Dec 2021 17:21:59 -0500 Subject: [PATCH] load apps when retrieving categories in order to create docker and kubernetes apps beforehand --- client/src/components/Home/Home.tsx | 7 ------- controllers/categories/getAllCategories.js | 4 ++++ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/client/src/components/Home/Home.tsx b/client/src/components/Home/Home.tsx index 73c8f4b..a6ed1ba 100644 --- a/client/src/components/Home/Home.tsx +++ b/client/src/components/Home/Home.tsx @@ -43,13 +43,6 @@ export const Home = (): JSX.Element => { } }, []); - // Load bookmarks - // useEffect(() => { - // if (!bookmarkCategories.length) { - // getBookmarkCategories(); - // } - // }, []); - useEffect(() => { if (localSearch) { // Search through apps diff --git a/controllers/categories/getAllCategories.js b/controllers/categories/getAllCategories.js index 42ae189..7ccdac1 100644 --- a/controllers/categories/getAllCategories.js +++ b/controllers/categories/getAllCategories.js @@ -4,6 +4,7 @@ const App = require('../../models/App'); const Bookmark = require('../../models/Bookmark'); const { Sequelize } = require('sequelize'); const loadConfig = require('../../utils/loadConfig'); +const getAllApps = require('../apps/getAllApps'); // @desc Get all categories // @route GET /api/categories @@ -11,6 +12,9 @@ const loadConfig = require('../../utils/loadConfig'); const getAllCategories = asyncWrapper(async (req, res, next) => { const { useOrdering: orderType } = await loadConfig(); + // Load apps to create apps from integrations (Docker, Kubernetes, etc.) + await getAllApps(req, res, next); + let categories; let output;