web/admin: migrate api calls to async (#4335)

migrate api calls to async

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens L
2023-01-02 16:13:07 +01:00
committed by GitHub
parent ba5cd6e719
commit ffed653cae
20 changed files with 85 additions and 109 deletions

View File

@ -32,8 +32,8 @@ export class RelatedGroupAdd extends Form<{ groups: string[] }> {
return t`Successfully added user to group(s).`;
}
send = (data: { groups: string[] }): Promise<{ groups: string[] }> => {
return Promise.all(
send = async (data: { groups: string[] }): Promise<{ groups: string[] }> => {
await Promise.all(
data.groups.map((group) => {
return new CoreApi(DEFAULT_CONFIG).coreGroupsAddUserCreate({
groupUuid: group,
@ -42,9 +42,8 @@ export class RelatedGroupAdd extends Form<{ groups: string[] }> {
},
});
}),
).then(() => {
return data;
});
);
return data;
};
renderForm(): TemplateResult {