mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 09:42:02 +08:00
FIX: middle click was reading every notifications (#9252)
This commit is contained in:
parent
445b35381d
commit
3f9b922d20
|
@ -163,7 +163,7 @@ export const DefaultNotificationItem = createWidget(
|
|||
this.attrs.set("read", true);
|
||||
ajax("/notifications/mark-read", {
|
||||
method: "PUT",
|
||||
data: this.attrs.id
|
||||
data: { id: this.attrs.id }
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,8 +32,15 @@ widgetTest("sets notification as read on middle click", {
|
|||
},
|
||||
async test(assert) {
|
||||
let requests = 0;
|
||||
pretender.put("/notifications/mark-read", () => {
|
||||
pretender.put("/notifications/mark-read", request => {
|
||||
++requests;
|
||||
|
||||
assert.equal(
|
||||
request.requestBody,
|
||||
`id=${this.args.id}`,
|
||||
"it sets correct request parameters"
|
||||
);
|
||||
|
||||
return [200, { "Content-Type": "application/json" }, { success: true }];
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user