diff --git a/web/wiki/CHANGELOG.md b/web/wiki/CHANGELOG.md index 752c5d128..53ad4083e 100644 --- a/web/wiki/CHANGELOG.md +++ b/web/wiki/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to this project will be documented in this file. +## [0.23.0] - 2024-07-31 + +### Changed + +- Replaced favMutation in FavoritesIcon component with corresponding openapi generated fetcher + ## [0.22.3] - 2024-07-30 ### Fixed diff --git a/web/wiki/package.json b/web/wiki/package.json index c330cdfd9..9bf780894 100644 --- a/web/wiki/package.json +++ b/web/wiki/package.json @@ -1,7 +1,7 @@ { "name": "web_wiki", "private": true, - "version": "0.22.3", + "version": "0.23.0", "type": "module", "scripts": { "dev": "vite", diff --git a/web/wiki/src/components/molecules/FavoritesIcon.tsx b/web/wiki/src/components/molecules/FavoritesIcon.tsx index 90c15321b..f090c6d0d 100644 --- a/web/wiki/src/components/molecules/FavoritesIcon.tsx +++ b/web/wiki/src/components/molecules/FavoritesIcon.tsx @@ -2,7 +2,7 @@ import { useQueryClient, useMutation } from '@tanstack/react-query' import { useTranslation } from 'react-i18next' import { Icon, colors } from '@itacademy/ui' import { FC } from 'react' -import { favMutation } from '../../helpers/fetchers' +import { fetchPutFavorites } from '../../openapi/openapiComponents' import { type TFavorites, type TResource } from '../../types' type TResourceFav = { @@ -20,7 +20,7 @@ export const FavoritesIcon: FC = ({ const { t } = useTranslation() const newFav = useMutation({ - mutationFn: favMutation, + mutationFn: fetchPutFavorites, onSuccess: () => { const queryCacheGetResources = queryClient .getQueryCache() @@ -79,7 +79,7 @@ export const FavoritesIcon: FC = ({ }) const handleFavorite = (id: string) => { - newFav.mutate(id) + newFav.mutate({ body: { id } }) } return (