我如何告诉邮递员扫描大于 0 的数字的响应?

How do i tell postman to scan a response for a number greater than 0?

我在这里设置了一个脚本

// the condition check
if (pm.response.json().totalPages === "1") {
    
    then change the method
    pm.variables.set("method", "POST")

    //call the same request again using setNExtRequest
    // pm.info.reqeustName gives current request's name
    postman.setNextRequest(pm.info.send)

如何设置让它在总页数大于 0 时运行?

我不知道 totalPages 的数据类型,所以我为 2 种情况提供了 2 种解决方案:

-如果totalPages是字符串:

if (parseInt(pm.response.json().totalPages) > 0)

-如果totalPages是数字:

if (pm.response.json().totalPages > 0)