FIX: Correctly save group invites (stable) (#25567)

regressed in 19b86e7ea2
This commit is contained in:
Jarek Radosz 2024-02-05 10:27:30 +01:00 committed by GitHub
parent 39dffcb657
commit 07fb62331c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 2 deletions

View File

@ -54,7 +54,7 @@ export default Component.extend(bufferedProperty("invite"), {
moment()
.add(this.siteSettings.invite_expiry_days, "days")
.format(FORMAT),
groupIds: this.model.invite?.groupIds,
groupIds: this.model.groupIds ?? this.model.invite?.groupIds,
topicId: this.model.invite?.topicId,
topicTitle: this.model.invite?.topicTitle,
});

View File

@ -36,7 +36,7 @@ export default DiscourseRoute.extend({
showInviteModal() {
const group = this.modelFor("group");
this.modal.show(CreateInvite, {
model: { invite: { groupIds: [group.id] } },
model: { groupIds: [group.id] },
});
},

View File

@ -262,6 +262,8 @@ acceptance(
},
]);
});
server.post("/invites", () => helper.response({}));
});
test("shows correct saved data in form", async function (assert) {
@ -281,6 +283,8 @@ acceptance(
await visit("/g/discourse");
await click(".group-members-invite");
assert.dom(".invite-to-groups .formatted-selection").hasText("Discourse");
await click(".save-invite");
});
}
);