Skip to content

Commit

Permalink
1457-fewiki-replace-favMutation-in-favoritesIcon-component-with-corre…
Browse files Browse the repository at this point in the history
…sponding-openapi-generated-fetcher (#1462)

* update FavoritesIcon.tsx

* update version in package.json & changelog

* delete console.error

* change version in package.json & changelog files and update FavoritesIcon

* delete async from FavoritesIcon

* change version in package.json & changelog files
  • Loading branch information
Fanur1991 authored Sep 16, 2024
1 parent 1837e02 commit 983d22a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
6 changes: 6 additions & 0 deletions web/wiki/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion web/wiki/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "web_wiki",
"private": true,
"version": "0.22.3",
"version": "0.23.0",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down
6 changes: 3 additions & 3 deletions web/wiki/src/components/molecules/FavoritesIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -20,7 +20,7 @@ export const FavoritesIcon: FC<TResourceFav> = ({
const { t } = useTranslation()

const newFav = useMutation({
mutationFn: favMutation,
mutationFn: fetchPutFavorites,
onSuccess: () => {
const queryCacheGetResources = queryClient
.getQueryCache()
Expand Down Expand Up @@ -79,7 +79,7 @@ export const FavoritesIcon: FC<TResourceFav> = ({
})

const handleFavorite = (id: string) => {
newFav.mutate(id)
newFav.mutate({ body: { id } })
}

return (
Expand Down

0 comments on commit 983d22a

Please sign in to comment.