feat: Implement isOwner flag for get flows API endpoint

This commit is contained in:
Faruk AYDIN
2025-03-31 21:18:33 +02:00
parent 351576b6b3
commit 59b887079a
10 changed files with 133 additions and 8 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);
@@ -9,6 +9,7 @@ const getFlowsMock = async (flows, steps) => {
status: flow.active ? 'published' : 'draft',
createdAt: flow.createdAt.getTime(),
updatedAt: flow.updatedAt.getTime(),
isOwner: flow.userId === currentUserId,
steps: flowSteps.map((step) => ({
appKey: step.appKey,
iconUrl: step.iconUrl,