fix(app): add friendly not-found handling
This commit is contained in:
@@ -211,7 +211,7 @@ export const get = query({
|
||||
handler: async (ctx, { threadId }) => {
|
||||
const ownerId = await getRequiredUserId(ctx);
|
||||
const thread = await ctx.db.get(threadId);
|
||||
if (thread?.ownerId !== ownerId) throw new ConvexError('Thread not found.');
|
||||
if (thread?.ownerId !== ownerId) return null;
|
||||
const spoon = thread.spoonId ? await ctx.db.get(thread.spoonId) : null;
|
||||
const job = thread.latestAgentJobId
|
||||
? await ctx.db.get(thread.latestAgentJobId)
|
||||
|
||||
Reference in New Issue
Block a user