[DEV-129] Remove "Delete ticket" from response form (#1038)

* Delete ticket button for logged user

* define variables
This commit is contained in:
Joel Elias Méndez 2021-09-27 11:16:25 -03:00 committed by GitHub
parent ffe7ef8e0b
commit 59fb9eaef3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 6 deletions

View File

@ -843,13 +843,13 @@ class TicketViewer extends React.Component {
showDeleteButton() {
const { ticket, userLevel, userId, userStaff } = this.props;
if(!ticket.owner) {
const { owner, author } = ticket || {};
const { staff, id } = author || {};
if(!owner) {
if(userLevel === 3) return true;
if(userId == ticket.author.id*1) {
if((userStaff && ticket.author.staff) || (!userStaff && !ticket.author.staff)){
return true;
}
if(userId == id*1) {
return ((userStaff && staff));
}
}