show gender on admin professional detail page
Add gender: true to users select in findById() (both lookup paths) and render it in the personal data card in the admin frontend. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
2180e0480c
commit
afbf4d537e
@@ -15,7 +15,7 @@ import {
|
|||||||
ExternalLink, Copy, ChevronLeft, ChevronRight, Calendar,
|
ExternalLink, Copy, ChevronLeft, ChevronRight, Calendar,
|
||||||
} from 'lucide-react';
|
} from 'lucide-react';
|
||||||
|
|
||||||
interface User { id: string; name: string; email?: string; phone?: string; city?: string; picture?: string; }
|
interface User { id: string; name: string; email?: string; phone?: string; city?: string; picture?: string; gender?: string | null; }
|
||||||
// DB convention: day_of_week 0=Mon … 6=Sun
|
// DB convention: day_of_week 0=Mon … 6=Sun
|
||||||
interface Schedule {
|
interface Schedule {
|
||||||
id: string; day_of_week: number; enabled: boolean; continuous_day?: boolean;
|
id: string; day_of_week: number; enabled: boolean; continuous_day?: boolean;
|
||||||
@@ -419,6 +419,10 @@ export default function ProfessionalDetailPage() {
|
|||||||
? <Input value={userForm.city} onChange={(e) => setUserForm({ ...userForm, city: e.target.value })} />
|
? <Input value={userForm.city} onChange={(e) => setUserForm({ ...userForm, city: e.target.value })} />
|
||||||
: <p className="font-medium">{user?.city || '—'}</p>}
|
: <p className="font-medium">{user?.city || '—'}</p>}
|
||||||
</div>
|
</div>
|
||||||
|
<div className="space-y-1">
|
||||||
|
<span className="text-muted-foreground">Género</span>
|
||||||
|
<p className="font-medium capitalize">{user?.gender || '—'}</p>
|
||||||
|
</div>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ export class ProfessionalsService {
|
|||||||
let prof = await this.prisma.professionals.findUnique({
|
let prof = await this.prisma.professionals.findUnique({
|
||||||
where: { id },
|
where: { id },
|
||||||
include: {
|
include: {
|
||||||
users: { select: { id: true, name: true, email: true, phone: true, picture: true, city: true } },
|
users: { select: { id: true, name: true, email: true, phone: true, picture: true, city: true, gender: true } },
|
||||||
schedules: { orderBy: { day_of_week: 'asc' } },
|
schedules: { orderBy: { day_of_week: 'asc' } },
|
||||||
specializations: true,
|
specializations: true,
|
||||||
payment_methods: true,
|
payment_methods: true,
|
||||||
@@ -56,7 +56,7 @@ export class ProfessionalsService {
|
|||||||
prof = await this.prisma.professionals.findUnique({
|
prof = await this.prisma.professionals.findUnique({
|
||||||
where: { user_id: id },
|
where: { user_id: id },
|
||||||
include: {
|
include: {
|
||||||
users: { select: { id: true, name: true, email: true, phone: true, picture: true, city: true } },
|
users: { select: { id: true, name: true, email: true, phone: true, picture: true, city: true, gender: true } },
|
||||||
schedules: { orderBy: { day_of_week: 'asc' } },
|
schedules: { orderBy: { day_of_week: 'asc' } },
|
||||||
specializations: true,
|
specializations: true,
|
||||||
payment_methods: true,
|
payment_methods: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user