Skip to content

Commit e86b08d

Browse files
authored
Merge pull request #45 from fuzziecoder/codex/fix-issue-and-raise-pr
Fix TypeScript errors in SpotHistory and moment types
2 parents bef8c77 + e65a709 commit e86b08d

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

components/SpotHistory.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import React, { useState, useEffect } from 'react';
22
import { HistoryIcon, Download, Filter } from 'lucide-react';
3-
import { supabase } from '../services/supabaseClient';
3+
import { supabase } from '../services/supabase';
44

55
interface SpotHistoryItem {
66
id: string;
77
name: string;
8-
date: string;
8+
created_at: string;
99
total_amount: number;
1010
payment_status: string;
1111
items_count: number;
@@ -42,7 +42,7 @@ export const SpotHistory: React.FC = () => {
4242
const handleExport = () => {
4343
// Export functionality to CSV/PDF
4444
const csv = history
45-
.map(item => `${item.name},${item.date},${item.total_amount},${item.payment_status}`)
45+
.map(item => `${item.name},${item.created_at},${item.total_amount},${item.payment_status}`)
4646
.join('\n');
4747

4848
const blob = new Blob([csv], { type: 'text/csv' });
@@ -115,7 +115,7 @@ export const SpotHistory: React.FC = () => {
115115
history.map((item) => (
116116
<tr key={item.id} className="hover:bg-gray-50">
117117
<td className="border border-gray-300 px-4 py-2">{item.name}</td>
118-
<td className="border border-gray-300 px-4 py-2">{new Date(item.date).toLocaleDateString()}</td>
118+
<td className="border border-gray-300 px-4 py-2">{new Date(item.created_at).toLocaleDateString()}</td>
119119
<td className="border border-gray-300 px-4 py-2 text-right">{item.total_amount.toFixed(2)}</td>
120120
<td className="border border-gray-300 px-4 py-2">
121121
<span className={`px-2 py-1 rounded text-sm ${

services/database.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { supabase } from './supabase';
2-
import { Spot, Invitation, Payment, InvitationStatus, PaymentStatus, UserProfile, Drink, Attendance, Cigarette, Food, Notification, DrinkBrand, UserDrinkSelection } from '../types';
2+
import { Spot, Invitation, Payment, InvitationStatus, PaymentStatus, UserProfile, Drink, Attendance, Cigarette, Food, Notification, DrinkBrand, UserDrinkSelection, Moment } from '../types';
33

44
/* -------------------------------------------------------------------------- */
55
/* SPOTS */

0 commit comments

Comments
 (0)