DEV: Use type instead of method in ajax calls (#8974)

Even though `type` is an alias for `method`, we have custom logic in `/discourse/lib/ajax` that checks only `type`, and ~200 other ajax calls in the codebase already use `type` param.
This commit is contained in:
Jarek Radosz
2020-03-26 21:00:10 +01:00
committed by GitHub
parent 17211b940f
commit 67b34600d5
27 changed files with 42 additions and 42 deletions

View File

@ -18,7 +18,7 @@ export default Controller.extend(bufferedProperty("model"), {
});
ajax("robots.json", {
method: "PUT",
type: "PUT",
data: { robots_txt: this.buffered.get("robots_txt") }
})
.then(data => {
@ -34,7 +34,7 @@ export default Controller.extend(bufferedProperty("model"), {
isSaving: true,
saved: false
});
ajax("robots.json", { method: "DELETE" })
ajax("robots.json", { type: "DELETE" })
.then(data => {
this.buffered.set("robots_txt", data.robots_txt);
this.commitBuffer();