fixed the bug
parent
413ce2e012
commit
e04b6d2634
|
@ -7,17 +7,24 @@ import re
|
||||||
from core.useractivity import user_logger, access_control
|
from core.useractivity import user_logger, access_control
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
# BASE_API = 'http://172.16.203.116/'
|
BASE_API = 'http://172.16.203.116/'
|
||||||
BASE_API = 'http://192.168.1.4/'
|
# BASE_API = 'http://192.168.1.4/'
|
||||||
|
default_password = '123456'
|
||||||
|
|
||||||
|
def login(acount):
|
||||||
def login():
|
"""
|
||||||
|
:param acount:
|
||||||
|
{
|
||||||
|
"user_name": "admin",
|
||||||
|
}
|
||||||
|
:return:
|
||||||
|
"""
|
||||||
url = BASE_API + "/api/v1.0/login"
|
url = BASE_API + "/api/v1.0/login"
|
||||||
|
|
||||||
payload = json.dumps({
|
payload = json.dumps({
|
||||||
"username": "admin",
|
"username": acount["user_name"],
|
||||||
"password": "123456",
|
"password": default_password,
|
||||||
"type": "account"
|
"type": 'account',
|
||||||
})
|
})
|
||||||
headers = {
|
headers = {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
|
@ -78,36 +85,8 @@ class TicketApplicationListCollection:
|
||||||
resp.status = falcon.HTTP_200
|
resp.status = falcon.HTTP_200
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def on_post(req, resp):
|
def on_get(req, resp):
|
||||||
|
user_name = req.get_param('username')
|
||||||
try:
|
|
||||||
raw_json = req.stream.read().decode('utf-8')
|
|
||||||
except Exception as ex:
|
|
||||||
raise falcon.HTTPError(falcon.HTTP_400, title='API.ERROR', description=ex)
|
|
||||||
"""
|
|
||||||
{
|
|
||||||
"user_name": "admin",
|
|
||||||
}"""
|
|
||||||
new_values = json.loads(raw_json)
|
|
||||||
|
|
||||||
checked_fields = [
|
|
||||||
{
|
|
||||||
"name": "user_name",
|
|
||||||
"type": str
|
|
||||||
},
|
|
||||||
]
|
|
||||||
|
|
||||||
for field in checked_fields:
|
|
||||||
_name = field['name']
|
|
||||||
_type = field['type']
|
|
||||||
if _name not in new_values.keys() or \
|
|
||||||
not isinstance(new_values[_name], _type) or \
|
|
||||||
len(str(new_values[_name])) == 0:
|
|
||||||
raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST',
|
|
||||||
description='API.INVALID_FIELD' + _name)
|
|
||||||
|
|
||||||
payload = new_values
|
|
||||||
user_name = payload['user_name']
|
|
||||||
|
|
||||||
cnx = mysql.connector.connect(**config.loonflow)
|
cnx = mysql.connector.connect(**config.loonflow)
|
||||||
cursor = cnx.cursor()
|
cursor = cnx.cursor()
|
||||||
|
@ -274,6 +253,7 @@ class TicketApplicationItem:
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def on_post(req, resp, id_):
|
def on_post(req, resp, id_):
|
||||||
"""Handles POST requests"""
|
"""Handles POST requests"""
|
||||||
|
|
||||||
try:
|
try:
|
||||||
raw_json = req.stream.read().decode('utf-8')
|
raw_json = req.stream.read().decode('utf-8')
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
|
@ -283,7 +263,7 @@ class TicketApplicationItem:
|
||||||
"title": "测试维修",
|
"title": "测试维修",
|
||||||
"long_field": "测试维修",
|
"long_field": "测试维修",
|
||||||
"transition_id": 29,
|
"transition_id": 29,
|
||||||
"workflow_id": 4
|
"workflow_id": 4,
|
||||||
}"""
|
}"""
|
||||||
print("id_", id_)
|
print("id_", id_)
|
||||||
new_values = json.loads(raw_json)
|
new_values = json.loads(raw_json)
|
||||||
|
@ -296,8 +276,7 @@ class TicketApplicationItem:
|
||||||
{
|
{
|
||||||
"name": "workflow_id",
|
"name": "workflow_id",
|
||||||
"type": int
|
"type": int
|
||||||
},
|
}
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|
||||||
for field in checked_fields:
|
for field in checked_fields:
|
||||||
|
@ -311,7 +290,9 @@ class TicketApplicationItem:
|
||||||
|
|
||||||
payload = new_values
|
payload = new_values
|
||||||
|
|
||||||
session = login()
|
session = login({
|
||||||
|
'user_name': req.get_param('username')
|
||||||
|
})
|
||||||
url = BASE_API + "/api/v1.0/tickets"
|
url = BASE_API + "/api/v1.0/tickets"
|
||||||
headers = {
|
headers = {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
|
@ -339,36 +320,9 @@ class TicketAgentListCollection:
|
||||||
resp.status = falcon.HTTP_200
|
resp.status = falcon.HTTP_200
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def on_post(req, resp):
|
def on_get(req, resp):
|
||||||
|
|
||||||
try:
|
user_name = req.get_param('username')
|
||||||
raw_json = req.stream.read().decode('utf-8')
|
|
||||||
except Exception as ex:
|
|
||||||
raise falcon.HTTPError(falcon.HTTP_400, title='API.ERROR', description=ex)
|
|
||||||
"""
|
|
||||||
{
|
|
||||||
"user_name": "admin",
|
|
||||||
}"""
|
|
||||||
new_values = json.loads(raw_json)
|
|
||||||
|
|
||||||
checked_fields = [
|
|
||||||
{
|
|
||||||
"name": "user_name",
|
|
||||||
"type": str
|
|
||||||
},
|
|
||||||
]
|
|
||||||
|
|
||||||
for field in checked_fields:
|
|
||||||
_name = field['name']
|
|
||||||
_type = field['type']
|
|
||||||
if _name not in new_values.keys() or \
|
|
||||||
not isinstance(new_values[_name], _type) or \
|
|
||||||
len(str(new_values[_name])) == 0:
|
|
||||||
raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST',
|
|
||||||
description='API.INVALID_FIELD' + _name)
|
|
||||||
|
|
||||||
payload = new_values
|
|
||||||
user_name = payload['user_name']
|
|
||||||
|
|
||||||
cnx = mysql.connector.connect(**config.loonflow)
|
cnx = mysql.connector.connect(**config.loonflow)
|
||||||
cursor = cnx.cursor()
|
cursor = cnx.cursor()
|
||||||
|
@ -676,9 +630,13 @@ class TicketStatusItem:
|
||||||
def on_get(req, resp, id_):
|
def on_get(req, resp, id_):
|
||||||
if not id_.isdigit() or int(id_) <= 0:
|
if not id_.isdigit() or int(id_) <= 0:
|
||||||
raise falcon.HTTPError(falcon.HTTP_400, '400 Bad Request')
|
raise falcon.HTTPError(falcon.HTTP_400, '400 Bad Request')
|
||||||
|
print(req.get_param('username'))
|
||||||
ticket_id = int(id_)
|
ticket_id = int(id_)
|
||||||
session = login()
|
session = login(
|
||||||
|
{
|
||||||
|
'user_name': req.get_param('username')
|
||||||
|
}
|
||||||
|
)
|
||||||
url = BASE_API + "/api/v1.0/tickets/"+id_+"/flowsteps"
|
url = BASE_API + "/api/v1.0/tickets/"+id_+"/flowsteps"
|
||||||
headers = {
|
headers = {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
|
@ -688,61 +646,61 @@ class TicketStatusItem:
|
||||||
print("content", content)
|
print("content", content)
|
||||||
resp.text = json.dumps(content)
|
resp.text = json.dumps(content)
|
||||||
|
|
||||||
@staticmethod
|
# @staticmethod
|
||||||
def on_post(req, resp, id_):
|
# def on_post(req, resp, id_):
|
||||||
"""Handles POST requests"""
|
# """Handles POST requests"""
|
||||||
try:
|
# try:
|
||||||
raw_json = req.stream.read().decode('utf-8')
|
# raw_json = req.stream.read().decode('utf-8')
|
||||||
except Exception as ex:
|
# except Exception as ex:
|
||||||
raise falcon.HTTPError(falcon.HTTP_400, title='API.ERROR', description=ex)
|
# raise falcon.HTTPError(falcon.HTTP_400, title='API.ERROR', description=ex)
|
||||||
"""
|
# """
|
||||||
{
|
# {
|
||||||
"title": "测试维修",
|
# "title": "测试维修",
|
||||||
"long_field": "测试维修",
|
# "long_field": "测试维修",
|
||||||
"transition_id": 29,
|
# "transition_id": 29,
|
||||||
"workflow_id": 4
|
# "workflow_id": 4
|
||||||
}"""
|
# }"""
|
||||||
print("id_", id_)
|
# print("id_", id_)
|
||||||
new_values = json.loads(raw_json)
|
# new_values = json.loads(raw_json)
|
||||||
|
#
|
||||||
checked_fields = [
|
# checked_fields = [
|
||||||
{
|
# {
|
||||||
"name": "transition_id",
|
# "name": "transition_id",
|
||||||
"type": int
|
# "type": int
|
||||||
},
|
# },
|
||||||
{
|
# {
|
||||||
"name": "workflow_id",
|
# "name": "workflow_id",
|
||||||
"type": int
|
# "type": int
|
||||||
},
|
# },
|
||||||
|
#
|
||||||
]
|
# ]
|
||||||
|
#
|
||||||
for field in checked_fields:
|
# for field in checked_fields:
|
||||||
_name = field['name']
|
# _name = field['name']
|
||||||
_type = field['type']
|
# _type = field['type']
|
||||||
if _name not in new_values.keys() or \
|
# if _name not in new_values.keys() or \
|
||||||
not isinstance(new_values[_name], _type) or \
|
# not isinstance(new_values[_name], _type) or \
|
||||||
len(str(new_values[_name])) == 0:
|
# len(str(new_values[_name])) == 0:
|
||||||
raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST',
|
# raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST',
|
||||||
description='API.INVALID_FIELD' + _name)
|
# description='API.INVALID_FIELD' + _name)
|
||||||
|
#
|
||||||
payload = new_values
|
# payload = new_values
|
||||||
|
#
|
||||||
session = login()
|
# session = login()
|
||||||
url = BASE_API + "/api/v1.0/tickets"
|
# url = BASE_API + "/api/v1.0/tickets"
|
||||||
headers = {
|
# headers = {
|
||||||
'Content-Type': 'application/json',
|
# 'Content-Type': 'application/json',
|
||||||
}
|
# }
|
||||||
resp = session.post(url, headers=headers, data=json.dumps(payload))
|
# resp = session.post(url, headers=headers, data=json.dumps(payload))
|
||||||
content = json.loads(resp.text)
|
# content = json.loads(resp.text)
|
||||||
print("content", content)
|
# print("content", content)
|
||||||
new_ticket_id = content.get('ticket_id')
|
# new_ticket_id = content.get('ticket_id')
|
||||||
print(resp.status_code)
|
# print(resp.status_code)
|
||||||
if resp.status_code != 200:
|
# if resp.status_code != 200:
|
||||||
raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_COOKIE',
|
# raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_COOKIE',
|
||||||
description='API.INVALID_STATUS_CODE:' + str(resp.status_code))
|
# description='API.INVALID_STATUS_CODE:' + str(resp.status_code))
|
||||||
resp.status = falcon.HTTP_201
|
# resp.status = falcon.HTTP_201
|
||||||
resp.location = '/tickets/' + str(new_ticket_id)
|
# resp.location = '/tickets/' + str(new_ticket_id)
|
||||||
|
|
||||||
|
|
||||||
class TicketFieldItem:
|
class TicketFieldItem:
|
||||||
|
@ -761,7 +719,7 @@ class TicketFieldItem:
|
||||||
raise falcon.HTTPError(falcon.HTTP_400, '400 Bad Request')
|
raise falcon.HTTPError(falcon.HTTP_400, '400 Bad Request')
|
||||||
|
|
||||||
ticket_id = int(id_)
|
ticket_id = int(id_)
|
||||||
session = login()
|
session = login({'user_name': req.get_param('username')})
|
||||||
url = BASE_API + "api/v1.0/tickets/" + id_
|
url = BASE_API + "api/v1.0/tickets/" + id_
|
||||||
headers = {
|
headers = {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
|
@ -788,7 +746,11 @@ class TicketTransitionItem:
|
||||||
raise falcon.HTTPError(falcon.HTTP_400, '400 Bad Request')
|
raise falcon.HTTPError(falcon.HTTP_400, '400 Bad Request')
|
||||||
|
|
||||||
ticket_id = int(id_)
|
ticket_id = int(id_)
|
||||||
session = login()
|
session = login(
|
||||||
|
{
|
||||||
|
'user_name': req.get_param('username')
|
||||||
|
}
|
||||||
|
)
|
||||||
url = BASE_API + "api/v1.0/tickets/" + id_ + "/transitions"
|
url = BASE_API + "api/v1.0/tickets/" + id_ + "/transitions"
|
||||||
headers = {
|
headers = {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
|
@ -828,7 +790,7 @@ class TicketAgentItem:
|
||||||
payload = new_values
|
payload = new_values
|
||||||
|
|
||||||
ticket_id = int(id_)
|
ticket_id = int(id_)
|
||||||
session = login()
|
session = login({'user_name': req.get_param('username')})
|
||||||
url = BASE_API + "api/v1.0/tickets/" + id_
|
url = BASE_API + "api/v1.0/tickets/" + id_
|
||||||
headers = {
|
headers = {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
|
@ -839,6 +801,36 @@ class TicketAgentItem:
|
||||||
resp.text = json.dumps(content)
|
resp.text = json.dumps(content)
|
||||||
|
|
||||||
|
|
||||||
|
class TicketListCollection:
|
||||||
|
@staticmethod
|
||||||
|
def __init__():
|
||||||
|
""""Initializes ContactCollection"""
|
||||||
|
pass
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def on_options(req, resp):
|
||||||
|
resp.status = falcon.HTTP_200
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def on_get(req, resp):
|
||||||
|
|
||||||
|
session = login(
|
||||||
|
{
|
||||||
|
'user_name': req.get_param('username')
|
||||||
|
}
|
||||||
|
)
|
||||||
|
url = BASE_API + "api/v1.0/tickets?category=owner"
|
||||||
|
headers = {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
}
|
||||||
|
get_resp = session.get(url, headers=headers)
|
||||||
|
print(get_resp)
|
||||||
|
print(get_resp.text)
|
||||||
|
content = json.loads(get_resp.text)
|
||||||
|
print("TicketListCollection content", content)
|
||||||
|
resp.text = json.dumps(content)
|
||||||
|
|
||||||
|
|
||||||
class ContactItem:
|
class ContactItem:
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def __init__():
|
def __init__():
|
||||||
|
|
|
@ -83,7 +83,7 @@ const TicketAggent = ({ setRedirect, setRedirectUrl, t }) => {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
let isResponseOK = false;
|
let isResponseOK = false;
|
||||||
// Get Ticket Type
|
// Get Ticket Type
|
||||||
fetch(APIBaseURL + '/ticket/types', {
|
fetch(APIBaseURL + '/ticket/types' + '?username=admin', {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-type': 'application/json'
|
'Content-type': 'application/json'
|
||||||
|
@ -115,14 +115,12 @@ const TicketAggent = ({ setRedirect, setRedirectUrl, t }) => {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
let isResponseOK = false;
|
let isResponseOK = false;
|
||||||
// Get Ticket List
|
// Get Ticket List
|
||||||
fetch(APIBaseURL + '/ticket/list/agent', {
|
fetch(APIBaseURL + '/ticket/list/agent' + '?username=admin', {
|
||||||
method: 'POST',
|
method: 'GET',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-type': 'application/json'
|
'Content-type': 'application/json'
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: null
|
||||||
user_name: 'admin'
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then(response => {
|
||||||
console.log(response);
|
console.log(response);
|
||||||
|
@ -168,7 +166,7 @@ const TicketAggent = ({ setRedirect, setRedirectUrl, t }) => {
|
||||||
setTicketId(id);
|
setTicketId(id);
|
||||||
// Get Ticket Status
|
// Get Ticket Status
|
||||||
let isResponseOK = false;
|
let isResponseOK = false;
|
||||||
fetch(APIBaseURL + '/ticket/status/' + id, {
|
fetch(APIBaseURL + '/ticket/status/' + id + '?username=admin', {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-type': 'application/json'
|
'Content-type': 'application/json'
|
||||||
|
@ -211,7 +209,7 @@ const TicketAggent = ({ setRedirect, setRedirectUrl, t }) => {
|
||||||
|
|
||||||
// Get Ticket Field
|
// Get Ticket Field
|
||||||
isResponseOK = false;
|
isResponseOK = false;
|
||||||
fetch(APIBaseURL + '/ticket/fields/' + id, {
|
fetch(APIBaseURL + '/ticket/fields/' + id + '?username=admin', {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-type': 'application/json'
|
'Content-type': 'application/json'
|
||||||
|
@ -242,7 +240,7 @@ const TicketAggent = ({ setRedirect, setRedirectUrl, t }) => {
|
||||||
|
|
||||||
// Get Ticket Transition Field
|
// Get Ticket Transition Field
|
||||||
isResponseOK = false;
|
isResponseOK = false;
|
||||||
fetch(APIBaseURL + '/ticket/transition/' + id, {
|
fetch(APIBaseURL + '/ticket/transition/' + id + '?username=admin', {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-type': 'application/json'
|
'Content-type': 'application/json'
|
||||||
|
@ -377,13 +375,13 @@ const TicketAggent = ({ setRedirect, setRedirectUrl, t }) => {
|
||||||
ticketFields.value.field_list.map(item => {
|
ticketFields.value.field_list.map(item => {
|
||||||
let item_key = item.field_key;
|
let item_key = item.field_key;
|
||||||
let value = item.field_value;
|
let value = item.field_value;
|
||||||
let temp = {}
|
let temp = {};
|
||||||
temp[item_key] = value;
|
temp[item_key] = value;
|
||||||
setTicketBody({ ...ticketBody, ...temp });
|
setTicketBody({ ...ticketBody, ...temp });
|
||||||
});
|
});
|
||||||
|
|
||||||
let isResponseOK = false;
|
let isResponseOK = false;
|
||||||
fetch(APIBaseURL + '/ticket/agent/' + ticketId, {
|
fetch(APIBaseURL + '/ticket/agent/' + ticketId + '?username=admin', {
|
||||||
method: 'PATCH',
|
method: 'PATCH',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-type': 'application/json'
|
'Content-type': 'application/json'
|
||||||
|
|
|
@ -111,14 +111,12 @@ const TicketApplication = ({ setRedirect, setRedirectUrl, t }) => {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
let isResponseOK = false;
|
let isResponseOK = false;
|
||||||
// Get Ticket List
|
// Get Ticket List
|
||||||
fetch(APIBaseURL + '/ticket/list/apply', {
|
fetch(APIBaseURL + '/ticket/list/apply' + '?username=admin', {
|
||||||
method: 'POST',
|
method: 'GET',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-type': 'application/json'
|
'Content-type': 'application/json'
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: null
|
||||||
user_name: 'admin'
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then(response => {
|
||||||
console.log(response);
|
console.log(response);
|
||||||
|
@ -142,16 +140,6 @@ const TicketApplication = ({ setRedirect, setRedirectUrl, t }) => {
|
||||||
|
|
||||||
const DetailedDataTable = loadable(() => import('../common/DetailedDataTable'));
|
const DetailedDataTable = loadable(() => import('../common/DetailedDataTable'));
|
||||||
|
|
||||||
const nameFormatter = (dataField, { name }) => (
|
|
||||||
<Link to="#">
|
|
||||||
<Media tag={Flex} align="center">
|
|
||||||
<Media body className="ml-2">
|
|
||||||
<h5 className="mb-0 fs--1">{name}</h5>
|
|
||||||
</Media>
|
|
||||||
</Media>
|
|
||||||
</Link>
|
|
||||||
);
|
|
||||||
|
|
||||||
const actionFormatter = (dataField, { id }) => (
|
const actionFormatter = (dataField, { id }) => (
|
||||||
// Control your row with this id
|
// Control your row with this id
|
||||||
<UncontrolledDropdown>
|
<UncontrolledDropdown>
|
||||||
|
@ -253,7 +241,7 @@ const TicketApplication = ({ setRedirect, setRedirectUrl, t }) => {
|
||||||
console.log('You apply the ticket!!', selectedTicketType);
|
console.log('You apply the ticket!!', selectedTicketType);
|
||||||
|
|
||||||
let isResponseOK = false;
|
let isResponseOK = false;
|
||||||
fetch(APIBaseURL + '/ticket/apply/' + selectedTicketType, {
|
fetch(APIBaseURL + '/ticket/apply/' + selectedTicketType + '?username=admin', {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-type': 'application/json'
|
'Content-type': 'application/json'
|
||||||
|
@ -294,19 +282,19 @@ const TicketApplication = ({ setRedirect, setRedirectUrl, t }) => {
|
||||||
console.log('submit----', ticketApplicationPayload);
|
console.log('submit----', ticketApplicationPayload);
|
||||||
|
|
||||||
let isResponseOK = false;
|
let isResponseOK = false;
|
||||||
fetch(APIBaseURL + '/ticket/apply/' + selectedTicketType, {
|
fetch(APIBaseURL + '/ticket/apply/' + selectedTicketType + '?username=admin', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-type': 'application/json'
|
'Content-type': 'application/json'
|
||||||
},
|
},
|
||||||
body: JSON.stringify(ticketApplicationPayload)
|
body: JSON.stringify({ ...ticketApplicationPayload })
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then(response => {
|
||||||
console.log(response);
|
console.log(response);
|
||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
isResponseOK = true;
|
isResponseOK = true;
|
||||||
}
|
}
|
||||||
return response.json();
|
return response.status;
|
||||||
})
|
})
|
||||||
.then(json => {
|
.then(json => {
|
||||||
if (isResponseOK) {
|
if (isResponseOK) {
|
||||||
|
@ -328,7 +316,7 @@ const TicketApplication = ({ setRedirect, setRedirectUrl, t }) => {
|
||||||
console.log('View Ticket Status', id);
|
console.log('View Ticket Status', id);
|
||||||
// Get Ticket Status
|
// Get Ticket Status
|
||||||
let isResponseOK = false;
|
let isResponseOK = false;
|
||||||
fetch(APIBaseURL + '/ticket/status/' + id, {
|
fetch(APIBaseURL + '/ticket/status/' + id + '?username=admin', {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-type': 'application/json'
|
'Content-type': 'application/json'
|
||||||
|
@ -377,7 +365,7 @@ const TicketApplication = ({ setRedirect, setRedirectUrl, t }) => {
|
||||||
console.log('View Ticket Record', id);
|
console.log('View Ticket Record', id);
|
||||||
// Get Ticket Status
|
// Get Ticket Status
|
||||||
let isResponseOK = false;
|
let isResponseOK = false;
|
||||||
fetch(APIBaseURL + '/ticket/status/' + id, {
|
fetch(APIBaseURL + '/ticket/status/' + id + '?username=admin', {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-type': 'application/json'
|
'Content-type': 'application/json'
|
||||||
|
@ -504,7 +492,7 @@ const TicketApplication = ({ setRedirect, setRedirectUrl, t }) => {
|
||||||
<ModalBody>
|
<ModalBody>
|
||||||
{ticketStatus && (
|
{ticketStatus && (
|
||||||
<Timeline mode="left">
|
<Timeline mode="left">
|
||||||
<Timeline.Item key={100} label={""}></Timeline.Item>
|
<Timeline.Item key={100} label={''} />
|
||||||
{ticketStatus.value
|
{ticketStatus.value
|
||||||
.filter(item => item.state_flow_log_list.length > 0)
|
.filter(item => item.state_flow_log_list.length > 0)
|
||||||
.map((item, index) => {
|
.map((item, index) => {
|
||||||
|
@ -518,7 +506,7 @@ const TicketApplication = ({ setRedirect, setRedirectUrl, t }) => {
|
||||||
</Timeline.Item>
|
</Timeline.Item>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
<Timeline.Item key={999} label={""}></Timeline.Item>
|
<Timeline.Item key={999} label={''} />
|
||||||
</Timeline>
|
</Timeline>
|
||||||
)}
|
)}
|
||||||
</ModalBody>
|
</ModalBody>
|
||||||
|
|
Loading…
Reference in New Issue