fix(04-05): three post-deploy bug fixes
- Admin client list: remove Timer column, rename Acconto→Importo incassato and Saldo→Importo da saldare (calculated from payment amounts, not badges) - Project workspace timer: pass projectId prop to TimerCell so it calls startTimer(projectId) directly instead of startTimerForClient(projectId) which was failing with "nessun progetto trovato" - Public client page: pass client.token (real DB token) not the URL path segment (which may be a slug) to ClientDashboard → fixes approve/chat APIs Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
import { useState, useEffect, useTransition } from "react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { startTimerForClient, stopTimer } from "@/app/admin/timer-actions";
|
||||
import { startTimer, startTimerForClient, stopTimer } from "@/app/admin/timer-actions";
|
||||
|
||||
function formatDuration(seconds: number): string {
|
||||
const h = Math.floor(seconds / 3600);
|
||||
@@ -14,11 +14,13 @@ function formatDuration(seconds: number): string {
|
||||
|
||||
export function TimerCell({
|
||||
clientId,
|
||||
projectId,
|
||||
activeEntryId,
|
||||
activeStartedAt,
|
||||
totalTrackedSeconds,
|
||||
}: {
|
||||
clientId: string;
|
||||
projectId?: string;
|
||||
activeEntryId: string | null;
|
||||
activeStartedAt: Date | null;
|
||||
totalTrackedSeconds: number;
|
||||
@@ -46,6 +48,8 @@ export function TimerCell({
|
||||
startTransition(async () => {
|
||||
if (isRunning && activeEntryId) {
|
||||
await stopTimer(activeEntryId);
|
||||
} else if (projectId) {
|
||||
await startTimer(projectId);
|
||||
} else {
|
||||
await startTimerForClient(clientId);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user