Migrate to external library for interacting with API

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
marcin mikołajczak
2024-08-04 16:09:52 +02:00
parent 963ffb3d45
commit 4dfdfcccd3
137 changed files with 1136 additions and 2094 deletions

View File

@ -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),
}),