i have an api call and want to keep it simple very...
# box-products
s
i have an api call and want to keep it simple very simple
Copy code
function users(event, rc, prc) {
        local.qusers = usersService.load(rc.userid);
        var st= = {};
        var c = queryToArray(local.qusers);
        st['statusCode'] = 200;
        st['results'] = c;
        return st;
    }
i want to add validation and if validation is wrong return the status code along with error and if its
true
, just return my
st
j
Copy code
if (cfhttp.StatusCode != 200)
    { writeOutput("Nope, because #cfhttp.StatusCode# ") }
else { writeOutput("Yay!") }
?