Skip to content

Commit

Permalink
chore: remove logsnag integration in remind.ts API route
Browse files Browse the repository at this point in the history
  • Loading branch information
taciturnaxolotl committed May 1, 2024
1 parent 402c004 commit d80dba7
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions src/pages/api/remind.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
import type { APIRoute } from "astro"
import { db, User, Organization, Event } from "astro:db";
import { LogSnag } from "logsnag";

const logsnag = new LogSnag({
token: process.env.LOGSNAG_TOKEN || "",
project: "magicsnap",
});

export const POST: APIRoute = async ({ request }) => {
// get authorization header
Expand All @@ -26,13 +20,6 @@ export const POST: APIRoute = async ({ request }) => {
return diffHours < 24 && diffHours > 0
})

await logsnag.track({
channel: "api",
event: "reminder-sent",
description: `Sent reminder to ${users.length} users in ${organizations.length} different organizations about ${eventsHappeningToday.length} events happening today`,
icon: "📬",
});

return new Response(JSON.stringify({
ok: true, eventsHappeningToday: eventsHappeningToday, users: users, organizations: organizations
}), { status: 200 })
Expand Down

0 comments on commit d80dba7

Please sign in to comment.