Skip to content

Commit

Permalink
preRebase
Browse files Browse the repository at this point in the history
  • Loading branch information
BuyankhuuTsCAl committed Apr 21, 2024
1 parent 2756019 commit cf03702
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/api/supabase/queries/product_queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export async function fetchProductByID(productId: number): Promise<Product> {
if (error) {
throw new Error(`Error fetching product: ${error.message}`);
}

return product;
}

Expand Down
4 changes: 3 additions & 1 deletion src/app/orderConfirmationDelivery/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ export default function OrderConfirmationDelivery() {
'November',
'December',
];
const dateStr = `${months[parseInt(date[1], 10)]} ${date[2]}, ${date[0]}`;
const dateStr = `${months[parseInt(date[1], 10) - 1]} ${date[2]}, ${
date[0]
}`;
return `${dateStr}`;
}

Expand Down
1 change: 1 addition & 0 deletions src/app/pickup/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ export default function PickUp() {
}
if (selectedPickupIndex === 0) {
toast(`You must select a pick-up date!`);
toast.clearWaitingQueue();
}
}}
>
Expand Down
2 changes: 1 addition & 1 deletion src/app/pickup/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,5 +269,5 @@ export const ToastPopUP = styled(ToastContainer)`
position: fixed;
z-index: 100;
transform: translatey(90px);
background-color: ${COLORS.lightRed};
`;
24 changes: 12 additions & 12 deletions src/app/profileScreen/individualItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@ export default function IndividualItem(props: {
const { favorite, Favorites, setFavorites } = props;
const [hovering, setHovering] = useState(false);

useEffect(() => {
async function changeCategory() {
try {
favorite.category = await convertButtonNumberToCategory(
favorite.category,
);
} catch (error) {
// console.error(error);
}
}
// useEffect(() => {
// // async function changeCategory() {
// // try {
// // favorite.category = await convertButtonNumberToCategory(
// // favorite.category,
// // );
// // } catch (error) {
// // // console.error(error);
// // }
// // }

changeCategory();
}, [favorite]);
// // changeCategory();
// }, []);

async function clickFunctions(props2: { fav: Product }) {
const { fav } = props2;
Expand Down
8 changes: 8 additions & 0 deletions src/app/profileScreen/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
Body2Bold,
Body2,
} from '@/styles/fonts';
import { convertButtonNumberToCategory } from '@/api/supabase/queries/button_queries';
import {
arrayOfFavorites,
fetchUser,
Expand Down Expand Up @@ -363,6 +364,13 @@ export default function Profile() {

async function fetchProducts() {
const data = (await arrayOfFavorites()) as Product[];
data.forEach(
async product =>
(product.category = await convertButtonNumberToCategory(
product.category,
)),
);
console.log(data);
setFavorites(data);
}

Expand Down

0 comments on commit cf03702

Please sign in to comment.