mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
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:
@@ -100,13 +100,11 @@ QUnit.test("creating simultaneously", assert => {
|
||||
});
|
||||
});
|
||||
|
||||
QUnit.test("destroyRecord", assert => {
|
||||
QUnit.test("destroyRecord", async assert => {
|
||||
const store = createStore();
|
||||
return store.find("widget", 123).then(function(widget) {
|
||||
widget.destroyRecord().then(function(result) {
|
||||
assert.ok(result);
|
||||
});
|
||||
});
|
||||
const widget = await store.find("widget", 123);
|
||||
|
||||
assert.ok(await widget.destroyRecord());
|
||||
});
|
||||
|
||||
QUnit.test("custom api name", async assert => {
|
||||
|
||||
@@ -114,21 +114,18 @@ QUnit.test("findAll", async assert => {
|
||||
assert.equal(widget.get("name"), "Evil Repellant");
|
||||
});
|
||||
|
||||
QUnit.test("destroyRecord", function(assert) {
|
||||
QUnit.test("destroyRecord", async assert => {
|
||||
const store = createStore();
|
||||
return store.find("widget", 123).then(function(w) {
|
||||
store.destroyRecord("widget", w).then(function(result) {
|
||||
assert.ok(result);
|
||||
});
|
||||
});
|
||||
const widget = await store.find("widget", 123);
|
||||
|
||||
assert.ok(await store.destroyRecord("widget", widget));
|
||||
});
|
||||
|
||||
QUnit.test("destroyRecord when new", function(assert) {
|
||||
QUnit.test("destroyRecord when new", async assert => {
|
||||
const store = createStore();
|
||||
const w = store.createRecord("widget", { name: "hello" });
|
||||
store.destroyRecord("widget", w).then(function(result) {
|
||||
assert.ok(result);
|
||||
});
|
||||
const widget = store.createRecord("widget", { name: "hello" });
|
||||
|
||||
assert.ok(await store.destroyRecord("widget", widget));
|
||||
});
|
||||
|
||||
QUnit.test("find embedded", async assert => {
|
||||
|
||||
Reference in New Issue
Block a user