diff --git a/Ordering.http b/Ordering.http index 958ad27..2b496d0 100644 --- a/Ordering.http +++ b/Ordering.http @@ -1,20 +1,4 @@ -{{ - 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; -}} - +# @import ./PreScript.http ### GET /products?order=id.desc diff --git a/PreScript.http b/PreScript.http new file mode 100644 index 0000000..e996b66 --- /dev/null +++ b/PreScript.http @@ -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; +}} \ No newline at end of file diff --git a/PreferHeader.http b/PreferHeader.http index 0a704fe..7171b0d 100644 --- a/PreferHeader.http +++ b/PreferHeader.http @@ -1,19 +1,4 @@ -{{ - 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; -}} + # @import ./PreScript.http ### POST /products diff --git a/Rest.http b/Rest.http index 6f41f40..c7f636a 100644 --- a/Rest.http +++ b/Rest.http @@ -1,19 +1,4 @@ -{{ - 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; -}} +# @import ./PreScript.http ### GET /products/1 @@ -22,7 +7,6 @@ GET /products/1 ?? body id == 1 ### - GET /products ?? status == 200 ?? body length == 77