Skip to content

Commit 5e0c525

Browse files
committed
Refactor code: Add logging to Discord for bounty submission details in unescrowedsubmission API
1 parent 115a82e commit 5e0c525

File tree

1 file changed

+5
-1
lines changed
  • src/app/api/unescrowedsubmission

1 file changed

+5
-1
lines changed

src/app/api/unescrowedsubmission/route.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { getUserByAuthHeader } from "@/lib/apiUtils";
22
import { bigintToString } from "@/lib/utils";
33
import { getBountySubmissions, setBountySubmission } from "@/utils/dbUtils";
4+
import { logToDiscord } from "@/utils/logger";
45
import { NextRequest, NextResponse } from "next/server";
56

67
export async function POST(req: NextRequest) {
@@ -25,7 +26,10 @@ export async function POST(req: NextRequest) {
2526
const response = bigintToString(
2627
await setBountySubmission(links, notes, walletAddress, bountyId, id, user)
2728
);
28-
29+
await logToDiscord(
30+
`User ${user.username} has submitted bounty ${bountyId} with
31+
links: ${links}, notes: ${notes}, walletAddress: ${walletAddress}`
32+
);
2933
return NextResponse.json({ response }, { status: 200 });
3034
} catch (error) {
3135
return NextResponse.json(

0 commit comments

Comments
 (0)