function apiReqsongsList($query) { $channel = channelOrDie($query); $reqsongs = dbListReqsongs($channel); if ($reqsongs === NULL) { tellError("database error", 500); } $response = array('reqsongs' => $reqsongs); tellSuccess($response); }
function getReqsongsOrDie($channel) { $reqsongs = dbListReqsongs($channel); if ($reqsongs === NULL) { respondMessage("database error"); return NULL; } else { return $reqsongs; } }