mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-13 01:59:28 +00:00
fix long lasting request getPrestudents to block browser when timedout once
This commit is contained in:
@@ -117,7 +117,10 @@ export default {
|
||||
return this.$fhcApi.post(
|
||||
'/api/frontend/v1/studstatus/leitung/getPrestudents',
|
||||
{ query },
|
||||
{ signal }
|
||||
{
|
||||
signal: signal,
|
||||
timeout: 30000
|
||||
}
|
||||
);
|
||||
},
|
||||
approve(antrag) {
|
||||
|
||||
@@ -35,8 +35,16 @@ export default {
|
||||
});
|
||||
},
|
||||
loadData(evt) {
|
||||
if (this.abortController)
|
||||
this.abortController.abort();
|
||||
if( evt.query.length < 2 )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.abortController instanceof AbortController
|
||||
&& this.abortController.signal.aborted === false)
|
||||
{
|
||||
this.abortController.abort();
|
||||
}
|
||||
this.abortController = new AbortController();
|
||||
|
||||
this.$fhcApi.factory
|
||||
@@ -44,7 +52,14 @@ export default {
|
||||
.then(result => {
|
||||
this.data = result.data;
|
||||
})
|
||||
.catch(this.$fhcApi.handleSystemError);
|
||||
.catch(error => {
|
||||
if (this.abortController instanceof AbortController
|
||||
&& this.abortController.signal.aborted === false)
|
||||
{
|
||||
this.abortController.abort();
|
||||
}
|
||||
this.$fhcApi.handleSystemError(error);
|
||||
});
|
||||
}
|
||||
},
|
||||
template: `
|
||||
|
||||
Reference in New Issue
Block a user