48 lines
1.2 KiB
HTTP
48 lines
1.2 KiB
HTTP
{{
|
|
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 /products?order=id
|
|
?? status == 200
|
|
?? js response.parsedBody[0].id == 1
|
|
?? js response.parsedBody[76].id == 77
|
|
|
|
###
|
|
|
|
GET /products?order=product_name.asc
|
|
?? status == 200
|
|
?? js response.parsedBody[0].id == 17
|
|
?? js response.parsedBody[76].id == 47
|
|
?? js response.parsedBody[0].product_name startsWith A
|
|
?? js response.parsedBody[76].product_name startsWith Z
|
|
|
|
###
|
|
|
|
GET /products?order=product_name.desc
|
|
?? status == 200
|
|
?? js response.parsedBody[0].id == 47
|
|
?? js response.parsedBody[76].id == 17
|
|
?? js response.parsedBody[0].product_name startsWith Z
|
|
?? js response.parsedBody[76].product_name startsWith A |