final 0.9
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user