Migrate to external library for interacting with API
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
import { Entities } from 'soapbox/entity-store/entities';
|
||||
import { useCreateEntity } from 'soapbox/entity-store/hooks';
|
||||
import { useApi } from 'soapbox/hooks';
|
||||
import { useClient } from 'soapbox/hooks';
|
||||
import { bookmarkFolderSchema } from 'soapbox/schemas/bookmark-folder';
|
||||
|
||||
interface UpdateBookmarkFolderParams {
|
||||
@ -9,12 +9,12 @@ interface UpdateBookmarkFolderParams {
|
||||
}
|
||||
|
||||
const useUpdateBookmarkFolder = (folderId: string) => {
|
||||
const api = useApi();
|
||||
const client = useClient();
|
||||
|
||||
const { createEntity, ...rest } = useCreateEntity(
|
||||
[Entities.BOOKMARK_FOLDERS],
|
||||
(params: UpdateBookmarkFolderParams) =>
|
||||
api(`/api/v1/pleroma/bookmark_folders/${folderId}`, {
|
||||
client.request(`/api/v1/pleroma/bookmark_folders/${folderId}`, {
|
||||
method: 'PATCH',
|
||||
body: JSON.stringify(params),
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user