web: mass update API calls
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
@ -49,7 +49,7 @@ export class UserDetailsPage extends LitElement {
|
||||
.send=${(data: unknown) => {
|
||||
return new CoreApi(DEFAULT_CONFIG).coreUsersUpdate({
|
||||
id: this.user?.pk || 0,
|
||||
data: data as User
|
||||
userRequest: data as User
|
||||
});
|
||||
}}>
|
||||
<form class="pf-c-form pf-m-horizontal">
|
||||
|
||||
@ -78,14 +78,14 @@ export class UserSettingsPage extends LitElement {
|
||||
<section slot="page-tokens" data-tab-title="${t`Tokens`}" class="pf-c-page__main-section pf-m-no-padding-mobile">
|
||||
<ak-user-token-list></ak-user-token-list>
|
||||
</section>
|
||||
${until(new StagesApi(DEFAULT_CONFIG).stagesAllUserSettings().then((stages) => {
|
||||
${until(new StagesApi(DEFAULT_CONFIG).stagesAllUserSettingsList().then((stages) => {
|
||||
return stages.map((stage) => {
|
||||
return html`<section slot="page-${stage.objectUid}" data-tab-title="${ifDefined(stage.title)}" class="pf-c-page__main-section pf-m-no-padding-mobile">
|
||||
${this.renderStageSettings(stage)}
|
||||
</section>`;
|
||||
});
|
||||
}))}
|
||||
${until(new SourcesApi(DEFAULT_CONFIG).sourcesAllUserSettings().then((source) => {
|
||||
${until(new SourcesApi(DEFAULT_CONFIG).sourcesAllUserSettingsList().then((source) => {
|
||||
return source.map((stage) => {
|
||||
return html`<section slot="page-${stage.objectUid}" data-tab-title="${ifDefined(stage.title)}" class="pf-c-page__main-section pf-m-no-padding-mobile">
|
||||
${this.renderSourceSettings(stage)}
|
||||
|
||||
@ -53,7 +53,7 @@ export class UserSettingsAuthenticatorWebAuthn extends BaseUserSettings {
|
||||
.send=${(data: unknown) => {
|
||||
return new AuthenticatorsApi(DEFAULT_CONFIG).authenticatorsWebauthnUpdate({
|
||||
id: device.pk || 0,
|
||||
data: data as WebAuthnDevice
|
||||
webAuthnDeviceRequest: data as WebAuthnDevice
|
||||
});
|
||||
}}>
|
||||
<form class="pf-c-form pf-m-horizontal">
|
||||
|
||||
@ -28,11 +28,11 @@ export class UserTokenForm extends ModelForm<Token, string> {
|
||||
if (this.instance) {
|
||||
return new CoreApi(DEFAULT_CONFIG).coreTokensUpdate({
|
||||
identifier: this.instance.identifier,
|
||||
data: data
|
||||
tokenRequest: data
|
||||
});
|
||||
} else {
|
||||
return new CoreApi(DEFAULT_CONFIG).coreTokensCreate({
|
||||
data: data
|
||||
tokenRequest: data
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user