Skip to content

Commit 99e7083

Browse files
committed
Revert "update"
This reverts commit c0e64e4.
1 parent c0e64e4 commit 99e7083

File tree

11 files changed

+117
-536
lines changed

11 files changed

+117
-536
lines changed

server/src/constants/index.ts

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

server/src/controllers/flows.controller.ts

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

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

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+
7083
public selectFlowsForChannel = catchAsync(
7184
async (req: RequestWithUser, res) => {
72-
const data = await this.flowService.selectChannelsForFlow(
73-
req.params.id,
85+
const data = await this.flowService.selectFlowsForChannel(
7486
req.user?.id as string
7587
);
7688
res.status(StatusCodes.OK).json({ data });

server/src/database/migrations/0004_dazzling_taskmaster.sql

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)