Replaced "baseUrl" with implicit "host" and fixed a minor bug regarding ordering

This commit is contained in:
matty
2023-10-25 16:34:47 +03:30
parent 247774b181
commit 3cd00d74bf
6 changed files with 51 additions and 22 deletions

View File

@@ -1,16 +1,37 @@
GET {{baseUrl}}/products?order=id.desc
{{
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;
}}
###
GET /products?order=id.desc
?? status == 200
?? js response.parsedBody[0].id == 77
?? js response.parsedBody[76].id == 1
###
GET {{baseUrl}}/products?order=id
GET /products?order=id
?? status == 200
?? js response.parsedBody[0].id == 1
?? js response.parsedBody[76].id == 77
###
GET {{baseUrl}}/products?order=product_name.asc
GET /products?order=product_name.asc
?? status == 200
?? js response.parsedBody[0].id == 17
?? js response.parsedBody[76].id == 47
@@ -18,7 +39,8 @@ GET {{baseUrl}}/products?order=product_name.asc
?? js response.parsedBody[76].product_name startsWith Z
###
GET {{baseUrl}}/products?order=product_name.desc
GET /products?order=product_name.desc
?? status == 200
?? js response.parsedBody[0].id == 47
?? js response.parsedBody[76].id == 17