I'm using contentful as backend for my mobile app.
match fixtures are stored within contentful. I want to query the next match, but i get the following error:
422 (Unprocessable Entity)
My function to retrieve the next match:
function nextOpponent(){
var content_Type = mainConfig.config.contentType.match // Matches
var order = "fields.datum";
var gt = new Date().toLocaleString();
console.log(gt);
var query = "content_type=" + content_Type +
"&order=" + order +
"&fields.datum%5Bgte%5D=" + encodeURI(gt);
contentful.entries(query).then(
//success
function(response){
$scope.nextMatch = response.data.items[0];
console.log($scope.nextMatch);
},
//error
function(response){
}
)
}