fix: make response status check case-insensitive (#51)
This commit is contained in:
Родитель
9605cd846b
Коммит
cc6d9be579
|
@ -583,9 +583,9 @@ export default class PredictPage extends React.Component<IPredictPageProps, IPre
|
|||
const checkSucceeded = (resolve, reject) => {
|
||||
const ajax = func();
|
||||
ajax.then((response) => {
|
||||
if (response.data.status === constants.statusCodeSucceeded) {
|
||||
if (response.data.status.toLowerCase() === constants.statusCodeSucceeded) {
|
||||
resolve(response.data);
|
||||
} else if (response.data.status === constants.statusCodeFailed) {
|
||||
} else if (response.data.status.toLowerCase() === constants.statusCodeFailed) {
|
||||
reject(_.get(
|
||||
response,
|
||||
"data.analyzeResult.errors[0].errorMessage",
|
||||
|
|
|
@ -127,7 +127,7 @@ export class OCRService {
|
|||
const checkSucceeded = (resolve, reject) => {
|
||||
const ajax = func();
|
||||
ajax.then((response) => {
|
||||
if (response.data.status === constants.statusCodeSucceeded) {
|
||||
if (response.data.status.toLowerCase() === constants.statusCodeSucceeded) {
|
||||
resolve(response.data);
|
||||
} else if (Number(new Date()) < endTime) {
|
||||
// If the request isn't succeeded and the timeout hasn't elapsed, go again
|
||||
|
|
Загрузка…
Ссылка в новой задаче