types#NewTaskComment TypeScript Examples

The following examples show how to use types#NewTaskComment. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CommentSlice.tsx    From knboard with MIT License 6 votes vote down vote up
createComment = createAsyncThunk<
  TaskComment | undefined,
  NewTaskComment
>("comment/createCommentStatus", async (comment, { dispatch }) => {
  try {
    const response: AxiosResponse<TaskComment> = await api.post(
      API_COMMENTS,
      comment
    );
    dispatch(createSuccessToast("Comment posted"));
    return response.data;
  } catch (err) {
    dispatch(createErrorToast(err.message));
  }
})