kopia lustrzana https://gitlab.com/soapbox-pub/soapbox
setTags: call endpoints synchronously
rodzic
6f236dd1e6
commit
f472e0cca6
|
@ -422,13 +422,11 @@ const untagUsers = (accountIds: string[], tags: string[]) =>
|
||||||
|
|
||||||
/** Synchronizes user tags to the backend. */
|
/** Synchronizes user tags to the backend. */
|
||||||
const setTags = (accountId: string, oldTags: string[], newTags: string[]) =>
|
const setTags = (accountId: string, oldTags: string[], newTags: string[]) =>
|
||||||
(dispatch: AppDispatch) => {
|
async(dispatch: AppDispatch) => {
|
||||||
const diff = getTagDiff(oldTags, newTags);
|
const diff = getTagDiff(oldTags, newTags);
|
||||||
|
|
||||||
return Promise.all([
|
await dispatch(tagUsers([accountId], diff.added));
|
||||||
dispatch(tagUsers([accountId], diff.added)),
|
await dispatch(untagUsers([accountId], diff.removed));
|
||||||
dispatch(untagUsers([accountId], diff.removed)),
|
|
||||||
]);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Synchronizes badges to the backend. */
|
/** Synchronizes badges to the backend. */
|
||||||
|
|
Ładowanie…
Reference in New Issue