mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-29 12:24:39 +00:00
fix(core): rename latest version child record on version stack rename (#312)
This commit is contained in:
@@ -1245,9 +1245,7 @@ export async function executeAgentToolActivity(params: ExecuteAgentToolParams):
|
||||
{ first: limit, after },
|
||||
)
|
||||
|
||||
const stackIds = assets
|
||||
.filter((a) => a.type === AssetType.version_stack && (!a.name || a.name === ''))
|
||||
.map((a) => a.id)
|
||||
const stackIds = assets.filter((a) => a.type === AssetType.version_stack).map((a) => a.id)
|
||||
|
||||
const latestVersionsMap = new Map<string, Prisma.AssetGetPayload<Record<string, never>>>()
|
||||
|
||||
@@ -1268,10 +1266,7 @@ export async function executeAgentToolActivity(params: ExecuteAgentToolParams):
|
||||
const latestVersion = latestVersionsMap.get(a.id)
|
||||
return {
|
||||
id: a.id,
|
||||
name:
|
||||
a.type === AssetType.version_stack && (!a.name || a.name === '')
|
||||
? (latestVersion?.name ?? a.name)
|
||||
: a.name,
|
||||
name: a.type === AssetType.version_stack ? (latestVersion?.name ?? a.name) : a.name,
|
||||
type: a.type,
|
||||
size:
|
||||
a.type === AssetType.version_stack && latestVersion
|
||||
|
||||
Reference in New Issue
Block a user