'data'
This commit is contained in:
@@ -46,6 +46,7 @@ export async function POST(request: NextRequest) {
|
||||
const region = String(formData.region || "").trim();
|
||||
const availableTime = String(formData.available_time || "").trim();
|
||||
const isVolunteer = !!formData.is_volunteer;
|
||||
const qualify = !!formData.qualify; // 女性且小红书帖子>10 时自动通过审核
|
||||
/** reason 仅存自我介绍,不合并其他字段 */
|
||||
const contact = wechatOrPhone || wechat || phone;
|
||||
if (!nickname || !session || !agreeRules) {
|
||||
@@ -85,6 +86,7 @@ export async function POST(request: NextRequest) {
|
||||
age_range: ageRangeForRecord,
|
||||
first_time: firstTime,
|
||||
is_volunteer: isVolunteer,
|
||||
qualify,
|
||||
};
|
||||
if (phone.trim()) {
|
||||
record.phone = phone.trim();
|
||||
@@ -133,6 +135,7 @@ async function tryPocketBaseDirect(
|
||||
const base = pb.url.replace(/\/$/, "");
|
||||
const url = `${base}/api/collections/${pb.joinCollection}/records`;
|
||||
|
||||
const qualify = !!(record.qualify ?? false);
|
||||
const body: Record<string, unknown> = {
|
||||
user_id: record.user_id,
|
||||
nickname: record.nickname,
|
||||
@@ -149,6 +152,7 @@ async function tryPocketBaseDirect(
|
||||
amount: record.amount ?? 0,
|
||||
xiaohongshu_url: record.xiaohongshu_url ?? "",
|
||||
is_volunteer: record.is_volunteer ?? false,
|
||||
is_approved: qualify,
|
||||
age_range: record.age_range ?? "",
|
||||
first_time: record.first_time ?? "",
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user