mirror of
https://github.com/opensupports/opensupports.git
synced 2025-07-31 01:35:15 +02:00
[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() {
|
showDeleteButton() {
|
||||||
const { ticket, userLevel, userId, userStaff } = this.props;
|
const { ticket, userLevel, userId, userStaff } = this.props;
|
||||||
|
const { owner, author } = ticket || {};
|
||||||
|
const { staff, id } = author || {};
|
||||||
|
|
||||||
if(!ticket.owner) {
|
if(!owner) {
|
||||||
if(userLevel === 3) return true;
|
if(userLevel === 3) return true;
|
||||||
if(userId == ticket.author.id*1) {
|
if(userId == id*1) {
|
||||||
if((userStaff && ticket.author.staff) || (!userStaff && !ticket.author.staff)){
|
return ((userStaff && staff));
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user