Skip to content

Commit

Permalink
feat: query by stringify object
Browse files Browse the repository at this point in the history
  • Loading branch information
sky172839465 committed Dec 8, 2024
1 parent 678d963 commit 2aa6aab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/apis/useFrontMatters.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import useSWR from 'swr'

export const fetcher = async (query) => {
const data = (await import('../data/frontMatters.json')).default
return filter(data, item => item.data.title.includes(query.title))
return filter(data, item => JSON.stringify(item).includes(query.title))
}

export const useFrontMatters = (query = {}, options = {}) => {
Expand Down

0 comments on commit 2aa6aab

Please sign in to comment.