fix(issues): only allow edit of own comments & do not allow non-admin delete of issues with comments (#2248)

This commit is contained in:
TheCatLady
2021-10-30 19:54:01 -04:00
committed by GitHub
parent 0828b008ba
commit bba09d69c1
5 changed files with 63 additions and 59 deletions

View File

@@ -260,7 +260,7 @@ const IssueDetails: React.FC = () => {
username: (
<Link
href={
issueData.createdBy.id === currentUser?.id
belongsToUser
? '/profile'
: `/users/${issueData.createdBy.id}`
}
@@ -294,8 +294,9 @@ const IssueDetails: React.FC = () => {
<div className="relative z-10 flex mt-6 text-gray-300">
<div className="flex-1 lg:pr-4">
<IssueDescription
issueId={issueData.id}
description={firstComment.message}
belongsToUser={belongsToUser}
commentCount={otherComments.length}
onEdit={(newMessage) => {
editFirstComment(newMessage);
}}