Fix Decimal.toFixed crash and new professionals default is_active
- Detail page: use Number() before toFixed() since Prisma returns Decimal objects - Service upsert: create professionals with is_active:false so they appear as pending Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
053f2d0b56
commit
f845350911
@@ -263,7 +263,7 @@ export default function ProfessionalDetailPage() {
|
||||
</div>
|
||||
<div className="space-y-1">
|
||||
<span className="text-muted-foreground">Puntuación promedio</span>
|
||||
<p className="font-medium">{professional.average_score != null ? `${professional.average_score.toFixed(1)} / 5` : '—'}</p>
|
||||
<p className="font-medium">{professional.average_score != null ? `${Number(professional.average_score).toFixed(1)} / 5` : '—'}</p>
|
||||
</div>
|
||||
<div className="space-y-1">
|
||||
<span className="text-muted-foreground">Código RETHUS</span>
|
||||
|
||||
@@ -72,7 +72,7 @@ export class ProfessionalsService {
|
||||
|
||||
if (!existing) {
|
||||
await this.prisma.users.update({ where: { id: userId }, data: { pro_state: 1 } });
|
||||
return this.prisma.professionals.create({ data: { user_id: userId, ...data } });
|
||||
return this.prisma.professionals.create({ data: { user_id: userId, is_active: false, ...data } });
|
||||
}
|
||||
|
||||
return this.prisma.professionals.update({ where: { user_id: userId }, data });
|
||||
|
||||
Reference in New Issue
Block a user