Error:
4/25/2026, 5:55:07 PM [CONVEX M(deletionRequests:create)] Uncaught Error: Failed to insert or update a document in table "deletionRequest" because it does not match the schema: Found ID "k1734jgrja57n1ragc59w1qqjn85e196" from table `categoryParticipants`, which does not match the table name in validator `v.id("user")`.Path: .requestedBy
at async handler (../convex/deletionRequests.ts:32:6)
mutation:
const create = mutation({
args: {
targetType: v.union(v.literal("player"), v.literal("playerPair")),
targetId: v.string(),
reason: v.string(),
},
handler: async (ctx, args) => {
const user = await authComponent.safeGetAuthUser(ctx);
if (!user) {
throw new Error("Unauthorized");
}
// Check for existing pending request for this target
const existing = await ctx.db
.query("deletionRequest")
.withIndex("by_target", (q) =>
q.eq("targetType", args.targetType).eq("targetId", args.targetId),
)
.filter((q) => q.eq(q.field("status"), "pending"))
.unique();
if (existing) {
throw new Error("A pending deletion request already exists for this item.");
}
const requestId = await ctx.db.insert("deletionRequest", {
targetType: args.targetType,
targetId: args.targetId,
reason: args.reason,
requestedBy: user._id,
status: "pending",
updatedAt: Date.now(),
});
return requestId;
},
});```
tell me if you need any more context.