Skip to content

Commit 72cdc0a

Browse files
committed
fix naming fo deployed by
1 parent a0da79d commit 72cdc0a

File tree

2 files changed

+7
-2
lines changed
  • apps/sim/app/api

2 files changed

+7
-2
lines changed

apps/sim/app/api/v1/admin/workflows/[id]/versions/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export const GET = withAdminAuthParams<RouteParams>(async (request, context) =>
3939
isActive: v.isActive,
4040
createdAt: v.createdAt.toISOString(),
4141
createdBy: v.createdBy,
42-
deployedByName: v.deployedByName,
42+
deployedByName: v.deployedByName ?? (v.createdBy === 'admin-api' ? 'Admin' : null),
4343
}))
4444

4545
logger.info(`Admin API: Listed ${versions.length} versions for workflow ${workflowId}`)

apps/sim/app/api/workflows/[id]/deployments/route.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export async function GET(request: NextRequest, { params }: { params: Promise<{
2121
return createErrorResponse(error.message, error.status)
2222
}
2323

24-
const versions = await db
24+
const rawVersions = await db
2525
.select({
2626
id: workflowDeploymentVersion.id,
2727
version: workflowDeploymentVersion.version,
@@ -36,6 +36,11 @@ export async function GET(request: NextRequest, { params }: { params: Promise<{
3636
.where(eq(workflowDeploymentVersion.workflowId, id))
3737
.orderBy(desc(workflowDeploymentVersion.version))
3838

39+
const versions = rawVersions.map((v) => ({
40+
...v,
41+
deployedBy: v.deployedBy ?? (v.createdBy === 'admin-api' ? 'Admin' : null),
42+
}))
43+
3944
return createSuccessResponse({ versions })
4045
} catch (error: any) {
4146
logger.error(`[${requestId}] Error listing deployments for workflow: ${id}`, error)

0 commit comments

Comments
 (0)