MCPcopy
hub / github.com/opactorai/Claudable / upsertUserRequest

Function upsertUserRequest

lib/services/user-requests.ts:58–78  ·  view source on GitHub ↗
({
  id,
  projectId,
  instruction,
  cliPreference,
}: UpsertUserRequestOptions)

Source from the content-addressed store, hash-verified

56 * Uses the client-provided requestId as the primary key.
57 */
58export async function upsertUserRequest({
59 id,
60 projectId,
61 instruction,
62 cliPreference,
63}: UpsertUserRequestOptions) {
64 return prisma.userRequest.upsert({
65 where: { id },
66 create: {
67 id,
68 projectId,
69 instruction,
70 status: 'pending',
71 ...(cliPreference !== undefined ? { cliPreference } : {}),
72 },
73 update: {
74 instruction,
75 ...(cliPreference !== undefined ? { cliPreference } : {}),
76 },
77 });
78}
79
80async function updateStatus(
81 id: string,

Callers 1

POSTFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected