feat(web): add affiliate kickback program for agents
Some checks failed
Deploy to 110 WOOO Server / deploy (push) Failing after 7s
Some checks failed
Deploy to 110 WOOO Server / deploy (push) Failing after 7s
This commit is contained in:
@@ -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
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user