Update superadmin invite URL (#62)
This commit is contained in:
parent
5531c3c33c
commit
ba69ac02bc
@ -69,24 +69,19 @@ export class InviteForm extends LiteElement {
|
||||
async onSubmit(event: { detail: { formData: FormData } }) {
|
||||
if (!this.authState) return;
|
||||
|
||||
this.serverError = undefined;
|
||||
this.isSubmitting = true;
|
||||
|
||||
const { formData } = event.detail;
|
||||
const inviteEmail = formData.get("inviteEmail") as string;
|
||||
|
||||
try {
|
||||
const data = await this.apiFetch(
|
||||
// TODO actual path
|
||||
`/invite`,
|
||||
this.authState,
|
||||
{
|
||||
method: "POST",
|
||||
body: JSON.stringify({
|
||||
email: inviteEmail,
|
||||
role: Number(formData.get("role")),
|
||||
}),
|
||||
}
|
||||
);
|
||||
const data = await this.apiFetch(`/users/invite`, this.authState, {
|
||||
method: "POST",
|
||||
body: JSON.stringify({
|
||||
email: inviteEmail,
|
||||
}),
|
||||
});
|
||||
|
||||
this.dispatchEvent(
|
||||
new CustomEvent("success", {
|
||||
|
@ -21,6 +21,11 @@ export class SignUpForm extends LiteElement {
|
||||
@property({ type: String })
|
||||
inviteToken?: string;
|
||||
|
||||
@property({ type: Boolean })
|
||||
// TODO replace with archive info
|
||||
// https://github.com/ikreymer/browsertrix-cloud/issues/35
|
||||
isArchiveInvite?: boolean;
|
||||
|
||||
@state()
|
||||
private serverError?: string;
|
||||
|
||||
@ -133,7 +138,7 @@ export class SignUpForm extends LiteElement {
|
||||
newArchive: true,
|
||||
};
|
||||
|
||||
if (this.inviteToken) {
|
||||
if (this.inviteToken && this.isArchiveInvite) {
|
||||
registerParams.inviteToken = this.inviteToken;
|
||||
registerParams.newArchive = false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user