Skip to content

Commit

Permalink
style: adjustments after self-review
Browse files Browse the repository at this point in the history
  • Loading branch information
wu-ciesielska committed Nov 24, 2023
1 parent d5287d3 commit 7229df8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/screens/admin/components/blog-posts/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ const BlogPosts = (props) => {
<div className="blog-posts-container">
<div className="blog-posts-title">Your blog posts</div>
{sortedBlogPosts.length > 0
&& sortedBlogPosts.map(
(post) => <BlogPost post={post} onClickEdit={() => openEditForm(post)} onDelete={() => openDeleteModal(post)} key={post.id} />,
)}
? sortedBlogPosts.map(
(post) => <BlogPost post={post} onClickEdit={() => openEditForm(post)} onDelete={() => openDeleteModal(post)} key={post.id} />,
) : <div>You haven&#39;t written any blog posts yet!</div>}
<EditBlogPost isOpen={showEditForm} setIsOpen={setShowEditForm} post={selectedBlogPost} onSubmit={handleFormSubmit} />
<DeleteModal handleDelete={handleDeleteBlogPost} isOpen={showDeleteModal} setIsOpen={setShowDeleteModal} title={selectedBlogPost.title} />

Expand Down
6 changes: 3 additions & 3 deletions src/state/actions/blog.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const ActionTypes = {
CREATE_BLOG_POST: 'CREATE_BLOG_POST',
};

export const createBlogPost = (fields, onSuccess) => {
export const createBlogPost = (fields, onSuccess = () => {}) => {
return async (dispatch) => {
try {
dispatch({ type: ActionTypes.CLEAR_API_ERROR });
Expand Down Expand Up @@ -47,7 +47,7 @@ export const getAllBlogPostsByAuthor = (onSuccess = () => {}, onError = () => {}
};
};

export const editBlogPost = (id, fields, onSuccess) => {
export const editBlogPost = (id, fields, onSuccess = () => {}) => {
return async (dispatch) => {
try {
dispatch({ type: ActionTypes.CLEAR_API_ERROR });
Expand All @@ -67,7 +67,7 @@ export const editBlogPost = (id, fields, onSuccess) => {
};
};

export const deleteBlogPost = (id, onSuccess) => {
export const deleteBlogPost = (id, onSuccess = () => {}) => {
return async (dispatch) => {
try {
const response = await BlogService.deleteBlogPost(id);
Expand Down

0 comments on commit 7229df8

Please sign in to comment.