Skip to content

Commit

Permalink
Remove unneeded ternary operators
Browse files Browse the repository at this point in the history
  • Loading branch information
fadihanna123 committed Sep 16, 2024
1 parent 3a69a01 commit 9ea0b68
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/containers/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const App = () => {

const { dispatch, searchForm } = useReduxConsts();
const imagesEndPoint: string = `?key=${PixabayKey}&q=${searchForm.query}`;
const videosEndPoint: string = `videos/?key=${PixabayKey}&q=${searchForm.query && searchForm.query}`;
const videosEndPoint: string = `videos/?key=${PixabayKey}&q=${searchForm.query}`;
const { data: imgData } = useAPI(imagesEndPoint, 'get', searchForm);
const { data: videoData } = useAPI(videosEndPoint, 'get', searchForm);

Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const useAPI = (
const getData = async () => {
setLoading(true);

axios[method](endPoint, headers && headers, JSON.parse(body ? body : null))
axios[method](endPoint, headers, JSON.parse(body ? body : null))
.then((res) => {
setData(res.data);
})
Expand Down

0 comments on commit 9ea0b68

Please sign in to comment.