Files
astuto/app/javascript/actions/Comment/handleCommentReplies.ts
Riccardo Graziosi dad382d2b1 Post follow and updates notifications V1 (#111)
* It is now possible to follow a post in order to receive updates about it
* Notifications are now sent when updates are published
* Post status changes are now tracked
* Update sidebar now shows the post status history
* Mark a comment as a post update using the comment form
* ... more ...
2022-05-28 11:03:36 +02:00

39 lines
1.1 KiB
TypeScript

export const TOGGLE_COMMENT_REPLY = 'TOGGLE_COMMENT_REPLY';
interface ToggleCommentReplyAction {
type: typeof TOGGLE_COMMENT_REPLY;
commentId: number;
}
export const SET_COMMENT_REPLY_BODY = 'SET_COMMENT_REPLY_BODY';
interface SetCommentReplyBodyAction {
type: typeof SET_COMMENT_REPLY_BODY;
commentId: number;
body: string;
}
export const TOGGLE_COMMENT_IS_POST_UPDATE_FLAG = 'TOGGLE_COMMENT_IS_POST_UPDATE_FLAG';
interface ToggleCommentIsPostUpdateFlag {
type: typeof TOGGLE_COMMENT_IS_POST_UPDATE_FLAG;
commentId: number;
}
export const toggleCommentReply = (commentId: number): ToggleCommentReplyAction => ({
type: TOGGLE_COMMENT_REPLY,
commentId,
});
export const setCommentReplyBody = (commentId: number, body: string): SetCommentReplyBodyAction => ({
type: SET_COMMENT_REPLY_BODY,
commentId,
body,
});
export const toggleCommentIsPostUpdateFlag = (commentId: number): ToggleCommentIsPostUpdateFlag => ({
type: TOGGLE_COMMENT_IS_POST_UPDATE_FLAG,
commentId,
});
export type HandleCommentRepliesType =
ToggleCommentReplyAction |
SetCommentReplyBodyAction |
ToggleCommentIsPostUpdateFlag;