We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 45fb40b commit 9a55b7aCopy full SHA for 9a55b7a
1 file changed
apps/sim/app/api/mothership/chats/[chatId]/fork/route.ts
@@ -52,7 +52,7 @@ export const POST = withRouteHandler(
52
.where(eq(copilotChats.id, chatId))
53
.limit(1)
54
55
- if (!parent || parent.userId !== userId) {
+ if (!parent || parent.userId !== userId || parent.type !== 'mothership') {
56
return createNotFoundResponse('Chat not found')
57
}
58
@@ -74,7 +74,8 @@ export const POST = withRouteHandler(
74
: []
75
76
const newId = generateId()
77
- const title = `${parent.title ?? 'New task'} | Fork`
+ const baseTitle = (parent.title ?? 'New task').replace(/ \| Fork$/, '')
78
+ const title = `${baseTitle} | Fork`
79
const now = new Date()
80
81
const [newChat] = await db
0 commit comments