Refactoring: Add PreScript.http
This commit is contained in:
15
PreScript.http
Normal file
15
PreScript.http
Normal file
@@ -0,0 +1,15 @@
|
||||
{{
|
||||
const axios = require('axios');
|
||||
const wait = axios.get(`${host}/products`).then(res => {
|
||||
let length = res.data.length;
|
||||
let exists = res.data.find(item => item.id === 78);
|
||||
if(length===78 && exists){
|
||||
return axios.delete(`${host}/products?id=eq.78`)
|
||||
.then(res => {
|
||||
return null;
|
||||
})
|
||||
}
|
||||
return null;
|
||||
})
|
||||
exports.wait = wait;
|
||||
}}
|
||||
Reference in New Issue
Block a user