Skip to content

Commit 6dfd5c1

Browse files
committed
adapters/crate: Fix query parameter name
see rust-lang#10380 (comment) 🙈
1 parent 19c80e0 commit 6dfd5c1

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

app/adapters/crate.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ export default class CrateAdapter extends ApplicationAdapter {
2525
return `${baseUrl}/${crateName}`;
2626
}
2727

28-
/** Adds a `reason` query parameter to the URL, if set in the `adapterOptions`. */
28+
/** Adds a `message` query parameter to the URL, if set in the `adapterOptions`. */
2929
urlForDeleteRecord(id, modelName, snapshot) {
3030
let url = super.urlForDeleteRecord(...arguments);
3131

32-
let reason = snapshot.adapterOptions.reason;
33-
if (reason) {
34-
url += `?reason=${encodeURIComponent(reason)}`;
32+
let message = snapshot.adapterOptions.message;
33+
if (message) {
34+
url += `?message=${encodeURIComponent(message)}`;
3535
}
3636

3737
return url;

app/controllers/crate/delete.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,8 @@ export default class CrateSettingsController extends Controller {
1717
}
1818

1919
deleteTask = task(async () => {
20-
let { reason } = this;
21-
2220
try {
23-
await this.model.destroyRecord({ adapterOptions: { reason } });
21+
await this.model.destroyRecord({ adapterOptions: { message: this.reason } });
2422
this.notifications.success(`Crate ${this.model.name} has been successfully deleted.`);
2523
this.router.transitionTo('index');
2624
} catch (error) {

0 commit comments

Comments
 (0)