Solved search string issue by updating router.
This commit is contained in:
parent
3ea7f6f83a
commit
73cdf19ac6
29245
package-lock.json
generated
29245
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
100
package.json
100
package.json
@ -1,52 +1,52 @@
|
||||
{
|
||||
"name": "meals-made-easy-app",
|
||||
"private": true,
|
||||
"version": "0.1.0",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "tsc && vite build",
|
||||
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
||||
"preview": "vite preview",
|
||||
"storybook": "storybook dev -p 6006",
|
||||
"build-storybook": "storybook build"
|
||||
},
|
||||
"dependencies": {
|
||||
"@fortawesome/fontawesome-svg-core": "^6.6.0",
|
||||
"@fortawesome/free-regular-svg-icons": "^6.6.0",
|
||||
"@fortawesome/free-solid-svg-icons": "^6.6.0",
|
||||
"@fortawesome/react-fontawesome": "^0.2.2",
|
||||
"@tanstack/react-query": "^5.45.1",
|
||||
"@tanstack/react-query-devtools": "^5.51.21",
|
||||
"@tanstack/react-router": "^1.38.1",
|
||||
"@tanstack/router-devtools": "^1.39.4",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"zod": "^3.23.8"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@chromatic-com/storybook": "^1.5.0",
|
||||
"@storybook/addon-essentials": "^8.1.10",
|
||||
"@storybook/addon-interactions": "^8.1.10",
|
||||
"@storybook/addon-links": "^8.1.10",
|
||||
"@storybook/addon-onboarding": "^8.1.10",
|
||||
"@storybook/blocks": "^8.1.10",
|
||||
"@storybook/react": "^8.1.10",
|
||||
"@storybook/react-vite": "^8.1.10",
|
||||
"@storybook/test": "^8.1.10",
|
||||
"@tanstack/router-vite-plugin": "^1.39.1",
|
||||
"@types/react": "^18.2.66",
|
||||
"@types/react-dom": "^18.2.22",
|
||||
"@typescript-eslint/eslint-plugin": "^7.2.0",
|
||||
"@typescript-eslint/parser": "^7.2.0",
|
||||
"@vitejs/plugin-react": "^4.2.1",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint-plugin-react-hooks": "^4.6.0",
|
||||
"eslint-plugin-react-refresh": "^0.4.6",
|
||||
"eslint-plugin-storybook": "^0.8.0",
|
||||
"prettier": "^3.3.2",
|
||||
"storybook": "^8.1.10",
|
||||
"typescript": "^5.2.2",
|
||||
"vite": "^5.2.0"
|
||||
}
|
||||
"name": "meals-made-easy-app",
|
||||
"private": true,
|
||||
"version": "0.1.0",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "tsc && vite build",
|
||||
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
||||
"preview": "vite preview",
|
||||
"storybook": "storybook dev -p 6006",
|
||||
"build-storybook": "storybook build"
|
||||
},
|
||||
"dependencies": {
|
||||
"@fortawesome/fontawesome-svg-core": "^6.6.0",
|
||||
"@fortawesome/free-regular-svg-icons": "^6.6.0",
|
||||
"@fortawesome/free-solid-svg-icons": "^6.6.0",
|
||||
"@fortawesome/react-fontawesome": "^0.2.2",
|
||||
"@tanstack/react-query": "^5.45.1",
|
||||
"@tanstack/react-query-devtools": "^5.51.21",
|
||||
"@tanstack/react-router": "^1.46.8",
|
||||
"@tanstack/router-devtools": "^1.39.4",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"zod": "^3.23.8"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@chromatic-com/storybook": "^1.5.0",
|
||||
"@storybook/addon-essentials": "^8.1.10",
|
||||
"@storybook/addon-interactions": "^8.1.10",
|
||||
"@storybook/addon-links": "^8.1.10",
|
||||
"@storybook/addon-onboarding": "^8.1.10",
|
||||
"@storybook/blocks": "^8.1.10",
|
||||
"@storybook/react": "^8.1.10",
|
||||
"@storybook/react-vite": "^8.1.10",
|
||||
"@storybook/test": "^8.1.10",
|
||||
"@tanstack/router-vite-plugin": "^1.39.1",
|
||||
"@types/react": "^18.2.66",
|
||||
"@types/react-dom": "^18.2.22",
|
||||
"@typescript-eslint/eslint-plugin": "^7.2.0",
|
||||
"@typescript-eslint/parser": "^7.2.0",
|
||||
"@vitejs/plugin-react": "^4.2.1",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint-plugin-react-hooks": "^4.6.0",
|
||||
"eslint-plugin-react-refresh": "^0.4.6",
|
||||
"eslint-plugin-storybook": "^0.8.0",
|
||||
"prettier": "^3.3.2",
|
||||
"storybook": "^8.1.10",
|
||||
"typescript": "^5.2.2",
|
||||
"vite": "^5.2.0"
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { useQuery } from '@tanstack/react-query'
|
||||
import { useQuery, useQueryClient } from '@tanstack/react-query'
|
||||
import { createFileRoute, useParams } from '@tanstack/react-router'
|
||||
import getRecipe from '../../api/getRecipe'
|
||||
import { useAuth } from '../../auth'
|
||||
@ -10,21 +10,25 @@ export const Route = createFileRoute('/recipes/$username/$slug')({
|
||||
from: '/recipes/$username/$slug'
|
||||
})
|
||||
const authContext = useAuth()
|
||||
const queryClient = useQueryClient()
|
||||
const {
|
||||
isLoading,
|
||||
error,
|
||||
data: recipe
|
||||
} = useQuery({
|
||||
queryKey: ['recipe', username, slug],
|
||||
queryFn({ signal: abortSignal }) {
|
||||
return getRecipe({
|
||||
abortSignal,
|
||||
authContext,
|
||||
username,
|
||||
slug
|
||||
})
|
||||
}
|
||||
})
|
||||
} = useQuery(
|
||||
{
|
||||
queryKey: ['recipe', username, slug],
|
||||
queryFn({ signal: abortSignal }) {
|
||||
return getRecipe({
|
||||
abortSignal,
|
||||
authContext,
|
||||
username,
|
||||
slug
|
||||
})
|
||||
}
|
||||
},
|
||||
queryClient
|
||||
)
|
||||
if (isLoading) {
|
||||
return 'Loading...'
|
||||
} else if (error !== null) {
|
||||
|
Loading…
Reference in New Issue
Block a user