final 0.9

This commit is contained in:
root
2025-12-31 07:49:35 +00:00
parent 312810bb56
commit 0d8c2ea3a3
13 changed files with 1195 additions and 41 deletions

View File

@@ -5,6 +5,7 @@ export interface User {
id: number
username: string
email: string
referral_points?: number
}
// Get the current user from session cookie
@@ -18,7 +19,7 @@ export async function getCurrentUser(): Promise<User | null> {
}
const [rows] = await pool.execute(
'SELECT id, username, email FROM buyers WHERE id = ?',
'SELECT id, username, email, referral_points FROM buyers WHERE id = ?',
[buyerId]
)
@@ -31,6 +32,7 @@ export async function getCurrentUser(): Promise<User | null> {
id: buyers[0].id,
username: buyers[0].username,
email: buyers[0].email,
referral_points: parseFloat(buyers[0].referral_points) || 0,
}
} catch (error) {
console.error('Error getting current user:', error)