Skip to content

Commit

Permalink
Add console
Browse files Browse the repository at this point in the history
  • Loading branch information
RockerFlower committed May 13, 2024
1 parent 728edee commit 3d07b66
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pages/api/cron/freshPOAP.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export default async function handler(req, res) {
try {
const lastUpdateTimestamp = await kvClient.get('lastUpdateTimestampOfPOAP') || INITIAL_TIMESTAMP;
const currentTimestamp = Math.floor(Date.now() / 1000);
console.info('Last update timestamp:', lastUpdateTimestamp);

const query = `
query {
Expand All @@ -40,8 +41,10 @@ export default async function handler(req, res) {
const { data } = await response.json();
const poaps = data.poaps;

const uniqueAddresses: string[] = Array.from(new Set(poaps.map((poap: any) => poap.collector_address)));
console.info('POAPs:', poaps);

const uniqueAddresses: string[] = Array.from(new Set(poaps.map((poap: any) => poap.collector_address)));
console.info('Unique addresses:', uniqueAddresses);
for (const address of uniqueAddresses) {
await fetch(`/api/poap/v/${address}`, { method: 'GET' });
}
Expand Down

0 comments on commit 3d07b66

Please sign in to comment.