Skip to content

Commit

Permalink
fixed edge case for if database was empty
Browse files Browse the repository at this point in the history
  • Loading branch information
G-Wang12 committed Jan 6, 2024
1 parent 567932d commit 6f2d8d4
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/hooks/product-details.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ const useProductDetails = (id: number) => {
try {
const response = await api.products.getProductDetails(id);
const productDetails = response.data;
console.log('data here: ', productDetails);
return {};
return productDetails || {};

} catch (err) {
if (process.env.NODE_ENV === 'development') {
Expand Down

0 comments on commit 6f2d8d4

Please sign in to comment.