Skip to content

Commit

Permalink
Update createDiscussion.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
MeyerPV committed Nov 20, 2024
1 parent fe53095 commit 4e583e1
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/store/states/common/saga/createDiscussion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,21 @@ export function* createDiscussion(
);

yield put(actions.setCommonAction(null));
yield put(actions.createDiscussion.success(discussion));
yield put(
actions.createDiscussion.success({
discussion,
commonId: payload.commonId,
}),
);

if (payload.callback) {
payload.callback(null, discussion);
}
} catch (error) {
if (isError(error)) {
yield put(actions.createDiscussion.failure(error));
yield put(
actions.createDiscussion.failure({ error, commonId: payload.commonId }),
);

if (payload.callback) {
payload.callback(error);
Expand Down

0 comments on commit 4e583e1

Please sign in to comment.