Skip to content

Commit c0e64e4

Browse files
committed
update
1 parent 79f2496 commit c0e64e4

File tree

11 files changed

+540
-118
lines changed

11 files changed

+540
-118
lines changed

server/src/constants/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,7 @@ export const ENDPOINTS = {
5353
INDEX: '/flow',
5454
GET_ONE: '/flow/get-one',
5555
PUBLISH: '/flow/publish-flow',
56-
ADD_CHANNELS: '/flow/add-channels',
57-
SELECT_FLOWS_FOR_CHANNEL: '/flow/select',
56+
SELECT_CHANNELS_FOR_FLOW: '/flow/select-channels',
5857
}
5958
};
6059

server/src/controllers/flows.controller.ts

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,12 @@ export class FlowController {
2222
});
2323

2424
public updateFlow = catchAsync(async (req: RequestWithUser, res) => {
25-
req.body.userId = req.user?.id;
2625
const data = await this.flowService.updateFlowById(
27-
req.params.id,
28-
req.body
26+
{
27+
fields: req.body,
28+
id: req.params.id,
29+
userId: req.user.id
30+
}
2931
);
3032
res.status(StatusCodes.OK).json({
3133
message: this.localeService.i18n().FLOW.UPDATE_SUCCESS(),
@@ -65,24 +67,10 @@ export class FlowController {
6567
res.status(StatusCodes.OK).json({ data });
6668
});
6769

68-
public addMultipleChannels = catchAsync(
69-
async (req: RequestWithUser, res) => {
70-
await this.flowService.addMultipleChannels(
71-
req.body.channelIds,
72-
req.body.flowId,
73-
req.user?.id as string
74-
);
75-
res.status(StatusCodes.OK).json({
76-
message: this.localeService
77-
.i18n()
78-
.FLOW.ADD_MULTIPLE_CHANNELS_FLOW__SUCCESS(),
79-
});
80-
}
81-
);
82-
8370
public selectFlowsForChannel = catchAsync(
8471
async (req: RequestWithUser, res) => {
85-
const data = await this.flowService.selectFlowsForChannel(
72+
const data = await this.flowService.selectChannelsForFlow(
73+
req.params.id,
8674
req.user?.id as string
8775
);
8876
res.status(StatusCodes.OK).json({ data });
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ALTER TABLE "flows" ALTER COLUMN "variables" SET DEFAULT '[]'::json;--> statement-breakpoint
2+
ALTER TABLE "flows" DROP COLUMN IF EXISTS "diagrams";

0 commit comments

Comments
 (0)