Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #37

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

TetianaVeremchuk
Copy link

Copy link

@DanilWeda DanilWeda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job.

Please check some small comments that I left.

If I miss something, tell me and I approve your solution.

Many thanks)

</span>
</div>

<!-- <p class="help is-danger">error message</p> -->

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

commented tag

Comment on lines +59 to +75
const indexToRemove = this.comments.findIndex(comment => comment.id === commentId);

if (indexToRemove === -1) {
return;
}

const commentToRemove = this.comments[indexToRemove];
this.comments.splice(indexToRemove, 1);

deleteComment(commentId)
.then((res) => {
console.log('success', res.data);
})
.catch((error) => {
this.comments.splice(indexToRemove, 0, commentToRemove);
console.error('Failed to delete comment:', error);
});

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const indexToRemove = this.comments.findIndex(comment => comment.id === commentId);
if (indexToRemove === -1) {
return;
}
const commentToRemove = this.comments[indexToRemove];
this.comments.splice(indexToRemove, 1);
deleteComment(commentId)
.then((res) => {
console.log('success', res.data);
})
.catch((error) => {
this.comments.splice(indexToRemove, 0, commentToRemove);
console.error('Failed to delete comment:', error);
});
this.comments = this.comments.filter(comment => comment.id !== commentId);
deleteComment(commentId)
.then((res) => {
console.log('success', res.data);
})
.catch((error) => {
this.comments.splice(indexToRemove, 0, commentToRemove);
console.error('Failed to delete comment:', error);
});

Maybe I missed something, but as I see we can simplify

</div>
</div>

<Sidebar class="Sidebar" :class="{ 'Sidebar--open': currentPostId !== 0 || showPostForm || isEditing }" :style="{'flex': '1 1 0%', 'padding-right': '10px'}">

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

currentPostId !== 0 || showPostForm || isEditing
It`s can be constant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants