Skip to content

Commit

Permalink
feat:queryExcludesIP
Browse files Browse the repository at this point in the history
  • Loading branch information
BuyankhuuTsCAl committed Apr 9, 2024
1 parent fd2f841 commit 01a6c0e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/api/supabase/queries/order_queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ export async function fetchOrdersByUser(): Promise<Order[]> {
const { data, error } = await supabase
.from('order')
.select('*')
.eq('user_id', userId);
.eq('user_id', userId)
.neq('status', 'In Progress');

if (error) {
throw new Error(`Error fetching orders for user: ${error.message}`);
Expand Down
1 change: 0 additions & 1 deletion src/api/supabase/queries/user_queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ export async function fetchCurrentUserAddress() {
if (error) {
console.error('Error fetching user data:', error);
}

return address;
} catch (error) {
console.error('Error:', error);
Expand Down
4 changes: 2 additions & 2 deletions src/app/orderHistory/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client';

import React, { useEffect, useState } from 'react';
import { Heading1 } from '@/styles/fonts';
import { Heading1, Body1 } from '@/styles/fonts';
import OrderDetailsWithProducts from '../../components/OrderHistory/OrderHistoryBox';
import { fetchOrderIdsByUserIdSorted } from '../../api/supabase/queries/order_queries';
import Footer from '../../components/FooterFolder/Footer';
Expand Down Expand Up @@ -37,7 +37,7 @@ function OrderHistory() {
<OrderDetailsWithProducts key={orderId} orderId={orderId} />
))
) : (
<div>Loading...</div>
<Body1>No Order</Body1>
)}
</OrderHistoryContainer>
</OutterBox>
Expand Down

0 comments on commit 01a6c0e

Please sign in to comment.