diff --git a/src/routers/slise-ad-rules/providers.ts b/src/routers/slise-ad-rules/providers.ts index f5fe297..19f8978 100644 --- a/src/routers/slise-ad-rules/providers.ts +++ b/src/routers/slise-ad-rules/providers.ts @@ -6,7 +6,7 @@ import { getAllSliseAdProvidersBySites, getSelectorsByProviderId, getSliseAdProvidersByDomain, - // getSliseAdProvidersForAllSites, + getSliseAdProvidersForAllSites, removeProviders, removeSliseAdProvidersBySites, removeSliseAdProvidersForAllSites, @@ -157,10 +157,9 @@ sliseAdProvidersRouter .route('/all-sites') .get( withExceptionHandler(async (_req, res) => { - // const providers = await getSliseAdProvidersForAllSites(); + const providers = await getSliseAdProvidersForAllSites(); - // res.status(200).send(providers); - res.status(200).header('Cache-Control', 'public, max-age=300').send([]); + res.status(200).header('Cache-Control', 'public, max-age=300').send(providers); }) ) .post( diff --git a/src/utils/express-helpers.ts b/src/utils/express-helpers.ts index 34f1745..7d39b6a 100644 --- a/src/utils/express-helpers.ts +++ b/src/utils/express-helpers.ts @@ -56,10 +56,9 @@ export const addObjectStorageMethodsToRouter = ( router.get( path === '/' ? `/:${keyName}` : `${path}/:${keyName}`, withExceptionHandler(async (req, res) => { - // const { [keyName]: key } = req.params; + const { [keyName]: key } = req.params; - // const value = await methods.getByKey(key); - const value = []; + const value = await methods.getByKey(key); res.status(200).header('Cache-Control', 'public, max-age=300').send(value); }) @@ -69,8 +68,7 @@ export const addObjectStorageMethodsToRouter = ( .route(path) .get( withExceptionHandler(async (_req, res) => { - // const values = await methods.getAllValues(); - const values = {}; + const values = await methods.getAllValues(); res.status(200).header('Cache-Control', 'public, max-age=300').send(values); })