-
Notifications
You must be signed in to change notification settings - Fork 149
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
base: main
Are you sure you want to change the base?
Develop #37
Conversation
There was a problem hiding this 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> --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
commented tag
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); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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'}"> |
There was a problem hiding this comment.
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
DEMO