mirror of
https://github.com/lobehub/lobe-chat.git
synced 2026-06-13 19:20:04 +00:00
✨ feat(server): add batchMoveTopics TRPC mutation
Expose TopicModel.batchMoveToAgent through a new topic.batchMoveTopics
lambda mutation (topic:update scoped permission, input { topicIds,
targetAgentId }) and add the matching topicService.batchMoveTopics client
wrapper.
Depends on the database layer (TopicModel.batchMoveToAgent).
Part of LOBE-10330
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -162,6 +162,18 @@ export const topicRouter = router({
|
||||
return ctx.topicModel.batchDeleteBySessionId(resolved.sessionId);
|
||||
}),
|
||||
|
||||
batchMoveTopics: topicProcedure
|
||||
.use(withScopedPermission('topic:update'))
|
||||
.input(
|
||||
z.object({
|
||||
targetAgentId: z.string(),
|
||||
topicIds: z.array(z.string()),
|
||||
}),
|
||||
)
|
||||
.mutation(async ({ input, ctx }) => {
|
||||
return ctx.topicModel.batchMoveToAgent(input.topicIds, input.targetAgentId);
|
||||
}),
|
||||
|
||||
cloneTopic: topicProcedure
|
||||
.use(withScopedPermission('topic:create'))
|
||||
.input(z.object({ id: z.string(), newTitle: z.string().optional() }))
|
||||
|
||||
@@ -32,6 +32,10 @@ export class TopicService {
|
||||
return lambdaClient.topic.cloneTopic.mutate({ id, newTitle });
|
||||
};
|
||||
|
||||
batchMoveTopics = (topicIds: string[], targetAgentId: string) => {
|
||||
return lambdaClient.topic.batchMoveTopics.mutate({ targetAgentId, topicIds });
|
||||
};
|
||||
|
||||
importTopic = (params: {
|
||||
agentId: string;
|
||||
data: string;
|
||||
|
||||
Reference in New Issue
Block a user