fix(web): revert smart merge (#6504)

* revert smart merge

* fix test

* fix test

* Remove Slider file
This commit is contained in:
Alex 2024-01-19 11:34:20 -06:00 committed by GitHub
parent df27460f1c
commit 07b874edda
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 74 additions and 147 deletions

View file

@ -26,7 +26,7 @@
let dispatch = createEventDispatcher<{
back: void;
merge: PersonResponseDto;
merge: void;
}>();
$: hasSelection = selectedPeople.length > 0;
@ -68,17 +68,16 @@
const handleMerge = async () => {
try {
let { data: results } = await api.personApi.mergePerson({
const { data: results } = await api.personApi.mergePerson({
id: person.id,
mergePersonDto: { ids: selectedPeople.map(({ id }) => id) },
});
const { data: mergedPerson } = await api.personApi.getPerson({ id: person.id });
const count = results.filter(({ success }) => success).length;
notificationController.show({
message: `Merged ${count} ${count === 1 ? 'person' : 'people'}`,
type: NotificationType.Info,
});
dispatch('merge', mergedPerson);
dispatch('merge');
} catch (error) {
handleError(error, 'Cannot merge people');
} finally {