[DEV-129] Remove "Delete ticket" from response form (#1038)
* Delete ticket button for logged user * define variables
This commit is contained in:
parent
ffe7ef8e0b
commit
59fb9eaef3
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue