feat: Implement isOwner flag to apps get flows API endpoint

This commit is contained in:
Faruk AYDIN
2025-04-01 16:29:13 +02:00
parent eb45b77c17
commit 988d3cbea6
3 changed files with 11 additions and 3 deletions

View File

@@ -1,4 +1,4 @@
const getFlowsMock = async (flows, steps) => {
const getFlowsMock = async (flows, steps, currentUserId) => {
const data = flows.map((flow) => {
const flowSteps = steps.filter((step) => step.flowId === flow.id);
@@ -7,6 +7,7 @@ const getFlowsMock = async (flows, steps) => {
id: flow.id,
name: flow.name,
status: flow.active ? 'published' : 'draft',
isOwner: flow.userId === currentUserId,
createdAt: flow.createdAt.getTime(),
updatedAt: flow.updatedAt.getTime(),
steps: flowSteps.map((step) => ({