web: mass update API calls

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer
2021-05-16 18:24:15 +02:00
parent 7152d7ee01
commit ba5374f6e1
64 changed files with 136 additions and 183 deletions

View File

@ -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">

View File

@ -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)}

View File

@ -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">

View File

@ -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
});
}
};