feat: Add Invitation Code to Generate Invitation Link (#2666)

Add auto-population of invitation fields in the registration page based on the invitation code in the link
This commit is contained in:
HGZ-20
2024-02-02 21:12:56 +08:00
committed by GitHub
parent bbbda1982f
commit b7be1943fa
56 changed files with 269 additions and 27 deletions

View File

@ -34,6 +34,16 @@ export function getInvitation(owner, name) {
}).then(res => res.json());
}
export function getInvitationCodeInfo(code, applicationName) {
return fetch(`${Setting.ServerUrl}/api/get-invitation-info?code=${code}&applicationId=${encodeURIComponent(applicationName)}`, {
method: "GET",
credentials: "include",
headers: {
"Accept-Language": Setting.getAcceptLanguage(),
},
}).then(res => res.json());
}
export function updateInvitation(owner, name, invitation) {
const newInvitation = Setting.deepCopy(invitation);
return fetch(`${Setting.ServerUrl}/api/update-invitation?id=${owner}/${encodeURIComponent(name)}`, {