diff --git a/src/routers/slise-ad-rules/providers.ts b/src/routers/slise-ad-rules/providers.ts index 7d8b610..f5fe297 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,9 +157,10 @@ 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).send(providers); + res.status(200).header('Cache-Control', 'public, max-age=300').send([]); }) ) .post( diff --git a/src/utils/express-helpers.ts b/src/utils/express-helpers.ts index 8a6e05b..34f1745 100644 --- a/src/utils/express-helpers.ts +++ b/src/utils/express-helpers.ts @@ -44,7 +44,7 @@ export const withExceptionHandler = } }; -export const addObjectStorageMethodsToRouter = ( +export const addObjectStorageMethodsToRouter = ( router: Router, path: string, methods: ObjectStorageMethods, @@ -56,11 +56,12 @@ 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 = await methods.getByKey(key); + const value = []; - res.status(200).send(value); + res.status(200).header('Cache-Control', 'public, max-age=300').send(value); }) ); @@ -68,9 +69,10 @@ export const addObjectStorageMethodsToRouter = ( .route(path) .get( withExceptionHandler(async (_req, res) => { - const values = await methods.getAllValues(); + // const values = await methods.getAllValues(); + const values = {}; - res.status(200).send(values); + res.status(200).header('Cache-Control', 'public, max-age=300').send(values); }) ) .post(