Now, with the two Celebrity objects retrieved, we need to add the logic to create and persist the players WouldYa results to the API. This involves creating a new object, that we will call a WouldYa.
function WouldYa(data) {
if (data) {
this.clazz = data.clazz;
this.selectedGuid = data.selectedGuid;
this.rejectedGuid = data.rejectedGuid;
} else {
this.clazz = "WouldYa";
this.selectedGuid = null;
this.rejectedGuid = null;
}
return this;
}
NEXT: Modify WouldYa View