[web] sponsors: remove impression logging to Redis
This commit is contained in:
parent
ed4b0d8e1b
commit
e0c56695e4
|
|
@ -1,20 +0,0 @@
|
|||
import type { NextRequest } from 'next/server';
|
||||
import { NextResponse } from 'next/server';
|
||||
import nullthrows from 'nullthrows';
|
||||
|
||||
import RedisCounter from '~/redis/RedisCounter';
|
||||
import { getErrorMessage } from '~/utils/getErrorMessage';
|
||||
|
||||
export async function POST(req: NextRequest) {
|
||||
try {
|
||||
const { a } = await req.json();
|
||||
|
||||
new RedisCounter('SPONSORSHIPS_AD_IMPRESSION', nullthrows(a)).incr();
|
||||
|
||||
return new NextResponse(null, { status: 204 });
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
|
||||
return NextResponse.json({ err: getErrorMessage(error) }, { status: 500 });
|
||||
}
|
||||
}
|
||||
|
|
@ -28,15 +28,6 @@ export default function useSponsorsAdImpressionLogging<T extends HTMLElement>(
|
|||
ad_placement: adPlacement,
|
||||
},
|
||||
});
|
||||
fetch(`/ads/impression`, {
|
||||
body: JSON.stringify({
|
||||
a: adId,
|
||||
}),
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
method: 'POST',
|
||||
});
|
||||
}, [adFormat, adId, adPlacement, isInView, pathname]);
|
||||
|
||||
return ref;
|
||||
|
|
|
|||
Loading…
Reference in New Issue