Skip to content

Commit

Permalink
feat: sort orders
Browse files Browse the repository at this point in the history
  • Loading branch information
altaywtf committed Dec 16, 2023
1 parent b6d6214 commit 3a79df2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/credits/components/order-list-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export function OrderListItem(props: Props) {
</Flex>

<Text color="gray" size="2">
{format(new Date(props.created_at), 'MMM d, yyyy')}
{format(new Date(props.created_at), 'HH:mm - MMM d, yyyy')}
</Text>
</Flex>

Expand Down
5 changes: 4 additions & 1 deletion app/credits/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ export default async function Page(props: Props) {
const supabase = createSupabaseServerClient(cookies());
const credits = await fetchAccountAICredits();
const prices = await getPrices();
const ordersQuery = await supabase.from('order').select('*');
const ordersQuery = await supabase
.from('order')
.select('*')
.order('created_at', { ascending: false });

return (
<Flex direction="column" gap="5">
Expand Down

0 comments on commit 3a79df2

Please sign in to comment.