feat: phone login, position badge, logout in profile, global search, admin chats
- Login: by phone number instead of username - Position field: shown as badge next to name in members list, search, admin panel - Logout: moved from sidebar to profile modal settings - Sidebar search: global — shows matching users with one-click private chat - Admin panel: new Чаты tab showing all chats with delete, position/phone in user form - Backend: /api/admin/chats endpoint, position column migration, phone login support Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -80,7 +80,7 @@ export default async function chatRoutes(app: FastifyInstance) {
|
||||
if (!chat) return reply.status(404).send({ error: 'Not found' });
|
||||
|
||||
const { rows: members } = await pool.query(`
|
||||
SELECT u.id, u.username, u.display_name, u.avatar_color, u.avatar, u.last_seen, cm.role, cm.can_send_messages
|
||||
SELECT u.id, u.username, u.display_name, u.avatar_color, u.avatar, u.position, u.last_seen, cm.role, cm.can_send_messages
|
||||
FROM chat_members cm
|
||||
JOIN users u ON u.id = cm.user_id
|
||||
WHERE cm.chat_id = $1
|
||||
@@ -104,6 +104,7 @@ export default async function chatRoutes(app: FastifyInstance) {
|
||||
members: members.map(m => ({
|
||||
id: m.id, username: m.username, displayName: m.display_name,
|
||||
avatarColor: m.avatar_color, avatar: m.avatar || null,
|
||||
position: m.position || null,
|
||||
role: m.role, online: onlineSet.has(m.id),
|
||||
lastSeen: m.last_seen, canSendMessages: m.can_send_messages,
|
||||
})),
|
||||
|
||||
Reference in New Issue
Block a user