Initial commit
This commit is contained in:
17
server/routes/webhooks/strava/athelete-update.post.ts
Normal file
17
server/routes/webhooks/strava/athelete-update.post.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { get, isEmpty } from "radash";
|
||||
import { eq } from "drizzle-orm";
|
||||
|
||||
export default defineEventHandler(async (event) => {
|
||||
const body = await readBody(event);
|
||||
const db = useDrizzle();
|
||||
|
||||
if (get(body, "updates.authorized") !== false) {
|
||||
return;
|
||||
}
|
||||
|
||||
await db
|
||||
.delete(tables.users)
|
||||
.where(eq(tables.users.id, get(body, "object_id")));
|
||||
|
||||
sendNoContent(event);
|
||||
});
|
||||
Reference in New Issue
Block a user