- ArrayFun.remove(this.challenges, ch => ch.id == c.id);
- if (!c.to) //TODO: send to everyone except me and opponent ?
- this.sendSomethingTo("", "deletechallenge", {cid: this.challenges[cIdx].id});
- if (c.type == "corr")
- {
- ajax(
- "/challenges",
- "DELETE",
- {id: this.challenges[cIdx].id}
- );
- }
+ ajax(
+ "/challenges",
+ accepted ? "PUT" : "DELETE",
+ {id: this.challenges[cIdx].id}
+ );