feat(web): add affiliate kickback program for agents
Some checks failed
Deploy to 110 WOOO Server / deploy (push) Failing after 7s

This commit is contained in:
OG T
2026-06-07 22:57:03 +08:00
parent 35b87d5fc9
commit bcfd5917a1
5 changed files with 48 additions and 1 deletions

View File

@@ -2,6 +2,7 @@
import { prisma } from "@/lib/prisma";
import { TaskStatus, TaskDifficulty } from "@agent-bounty/contracts";
import { cookies } from "next/headers";
import { redirect } from "next/navigation";
import Stripe from "stripe";
@@ -12,6 +13,9 @@ const stripe = process.env.STRIPE_SECRET_KEY
: null;
export async function createTask(formData: FormData) {
const cookieStore = await cookies();
const referralAgent = cookieStore.get("vw_referral_agent")?.value;
const title = formData.get("title") as string;
const description = formData.get("description") as string;
const rewardAmount = parseInt(formData.get("rewardAmount") as string, 10) * 100; // to cents
@@ -38,7 +42,8 @@ export async function createTask(formData: FormData) {
test_file_content: testFileContent
},
is_priority: isPriority,
is_private: isPrivate
is_private: isPrivate,
referred_by_agent: referralAgent || null
}
});