Skip to content

Commit

Permalink
Merge pull request #20 from lidofinance/feature/si-684-actualize-stak…
Browse files Browse the repository at this point in the history
…e-widget-api-tests

Update api tests
  • Loading branch information
itaven authored Aug 17, 2023
2 parents e74baa0 + 65b228e commit 09e2808
Show file tree
Hide file tree
Showing 4 changed files with 207 additions and 303 deletions.
15 changes: 8 additions & 7 deletions pages/api/csp-report.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { NextApiRequest, NextApiResponse } from 'next';
import { wrapRequest as wrapNextRequest } from '@lidofinance/next-api-wrapper';
import { defaultErrorHandler, rateLimit } from 'utilsApi';
import { API } from 'types';

export default function cspReport(
req: NextApiRequest,
res: NextApiResponse,
): void {
const cspReport: API = async (req, res) => {
console.warn({
type: 'CSP Violation',
...JSON.parse(req.body),
...req.body,
});

res.status(200).send({ status: 'ok' });
}
};

export default wrapNextRequest([rateLimit, defaultErrorHandler])(cspReport);
2 changes: 1 addition & 1 deletion pages/api/eth-apr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const cache = new Cache<typeof CACHE_ETH_APR_KEY, string>();
// Proxy for third-party API.
// Returns eth annual percentage rate
// TODO: delete after viewing grafana
const ethApr: API = async (req, res) => {
const ethApr: API = async (_, res) => {
const cachedEthApr = cache.get(CACHE_ETH_APR_KEY);

if (cachedEthApr) {
Expand Down
2 changes: 1 addition & 1 deletion pages/api/sma-steth-apr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import Metrics from 'utilsApi/metrics';
const cache = new Cache<typeof CACHE_SMA_STETH_APR_KEY, string>();

// TODO: deprecated, will be delete after check grafana dashboards
const smaStethApr: API = async (req, res) => {
const smaStethApr: API = async (_, res) => {
const cachedStethApr = cache.get(CACHE_SMA_STETH_APR_KEY);

if (cachedStethApr) {
Expand Down
Loading

0 comments on commit 09e2808

Please sign in to comment.