Updated names for uniformity
This commit is contained in:
@@ -72,7 +72,11 @@ function DebouncedGroupSettingsItem({
|
||||
|
||||
useEffect(() => {
|
||||
if (Object.keys(debounced).length) {
|
||||
mutateAsync({ method: 'PATCH', endpoint: 'api/categories', body: debounced });
|
||||
mutateAsync({
|
||||
method: 'PATCH',
|
||||
endpoint: 'api/bookmarkCategories',
|
||||
body: debounced,
|
||||
});
|
||||
setUpdate({});
|
||||
}
|
||||
}, [debounced]);
|
||||
@@ -85,7 +89,7 @@ function DebouncedGroupSettingsItem({
|
||||
|
||||
useEffect(() => {
|
||||
if (bookmarkList && bookmarkList !== bookmarks) {
|
||||
mutateAsync({ method: 'PATCH', endpoint: 'api/linkOrder', body: bookmarkList });
|
||||
mutateAsync({ method: 'PATCH', endpoint: 'api/bookmarkOrder', body: bookmarkList });
|
||||
}
|
||||
}, [bookmarkList]);
|
||||
|
||||
@@ -94,6 +98,10 @@ function DebouncedGroupSettingsItem({
|
||||
<DeleteItemModal
|
||||
modalOpened={modalOpened}
|
||||
handleClose={closeModal}
|
||||
handleDelete={() => {
|
||||
handleDelete(bookmarks, 'api/bookmarks');
|
||||
handleDelete(group, 'api/bookmarkCategories');
|
||||
}}
|
||||
title='Delete message'
|
||||
body={
|
||||
<Stack gap={0} w={'100%'} h={'175px'} align='center'>
|
||||
@@ -113,28 +121,6 @@ function DebouncedGroupSettingsItem({
|
||||
This will also delete all bookmarks in this group!
|
||||
</Text>
|
||||
<Text c='red'>This action cannot be undone!</Text>
|
||||
<Group pos={'absolute'} bottom={8}>
|
||||
<Button
|
||||
color={'red'}
|
||||
styles={{ label: { color: 'black' } }}
|
||||
onClick={() => {
|
||||
handleDelete(bookmarks, 'api/links');
|
||||
handleDelete(group, 'api/categories');
|
||||
closeModal();
|
||||
}}
|
||||
>
|
||||
Delete
|
||||
</Button>
|
||||
<Button
|
||||
color={'var(--color-text-acc)'}
|
||||
styles={{ label: { color: 'var(--color-text-pri)' } }}
|
||||
onClick={() => {
|
||||
closeModal();
|
||||
}}
|
||||
>
|
||||
Cancel
|
||||
</Button>
|
||||
</Group>
|
||||
</Stack>
|
||||
}
|
||||
/>
|
||||
@@ -401,7 +387,7 @@ function DebouncedGroupSettingsItem({
|
||||
if (newBookmark) {
|
||||
mutateAsync({
|
||||
method: 'POST',
|
||||
endpoint: 'api/links',
|
||||
endpoint: 'api/bookmarks',
|
||||
body: { ...newBookmark, index: bookmarks.length },
|
||||
});
|
||||
setPopoverOpened(false);
|
||||
|
||||
Reference in New Issue
Block a user