-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Phones from api #19
Phones from api #19
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GJ! Just delete the comment
src/pages/CatalogPage.tsx
Outdated
import { Dropdown } from '../components/Dropdown'; | ||
import { Card } from '../components/Card'; | ||
import axios from 'axios'; | ||
// import axios from 'axios'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete comment
src/redux/api/product.ts
Outdated
import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query/react'; | ||
|
||
export const productApi = createApi({ | ||
baseQuery: fetchBaseQuery({ | ||
baseUrl: 'https://dreamteam.onrender.com', | ||
}), | ||
endpoints: (builder) => ({ | ||
getProducts: builder.query({ | ||
query: () => `/products`, | ||
}), | ||
}), | ||
}); | ||
|
||
export const { useGetProductsQuery } = productApi; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename file to your func
} = useGetProductsQuery({ | ||
perPage, | ||
page: currentPage, | ||
sortBy, | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here u passing props but your query doesn't accept them
src/redux/api/product.ts
Outdated
getProducts: builder.query({ | ||
query: () => `/products`, | ||
}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here you need accept those props and return the object like ({})
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome
No description provided.