Skip to content
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

Merged
merged 7 commits into from
Sep 5, 2023
Merged

Phones from api #19

merged 7 commits into from
Sep 5, 2023

Conversation

OlhaSheliakina
Copy link
Contributor

No description provided.

Copy link
Member

@olena-ole olena-ole left a 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

import { Dropdown } from '../components/Dropdown';
import { Card } from '../components/Card';
import axios from 'axios';
// import axios from 'axios';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete comment

Comment on lines 1 to 14
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;
Copy link
Contributor

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

Comment on lines +46 to +50
} = useGetProductsQuery({
perPage,
page: currentPage,
sortBy,
});
Copy link
Contributor

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

Comment on lines 8 to 10
getProducts: builder.query({
query: () => `/products`,
}),
Copy link
Contributor

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 ({})

Copy link
Contributor

@MaxSchmide MaxSchmide left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome

@MaxSchmide MaxSchmide merged commit 86213e5 into master Sep 5, 2023
1 check passed
@MaxSchmide MaxSchmide deleted the phones-from-api branch September 5, 2023 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants