allow users to delete threads from spoons details page
Build and Push Spoon Images / quality (push) Successful in 2m36s
Build and Push Spoon Images / build-images (push) Successful in 9m21s

This commit is contained in:
Gabriel Brown
2026-06-23 16:00:34 -04:00
parent a6f7ea7f78
commit 5567a4be95
8 changed files with 493 additions and 221 deletions
+21 -1
View File
@@ -178,11 +178,31 @@ export const listForSpoon = query({
handler: async (ctx, { spoonId, limit }) => {
const ownerId = await getRequiredUserId(ctx);
await getOwnedSpoon(ctx, spoonId, ownerId);
return await ctx.db
const threads = await ctx.db
.query('threads')
.withIndex('by_spoon', (q) => q.eq('spoonId', spoonId))
.order('desc')
.take(limit ?? 25);
return await Promise.all(
threads.map(async (thread) => {
const latestJob = thread.latestAgentJobId
? await ctx.db.get(thread.latestAgentJobId)
: null;
return {
...publicThread(thread),
latestJobStatus:
latestJob?.ownerId === ownerId ? latestJob.status : undefined,
latestJobWorkspaceStatus:
latestJob?.ownerId === ownerId
? latestJob.workspaceStatus
: undefined,
latestJobPullRequestUrl:
latestJob?.ownerId === ownerId
? latestJob.pullRequestUrl
: undefined,
};
}),
);
},
});