mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-08 00:02:15 +01:00
Fix bugs in computed attribute calculation
This commit is contained in:
committed by
Constantin Graf
parent
69d3ff4f7b
commit
4c27f1a2de
@@ -450,6 +450,10 @@ class TimeEntryController extends Controller
|
||||
$ids = $request->validated('ids');
|
||||
$timeEntries = TimeEntry::query()
|
||||
->whereBelongsTo($organization, 'organization')
|
||||
->with([
|
||||
'project',
|
||||
'task',
|
||||
])
|
||||
->whereIn('id', $ids)
|
||||
->get();
|
||||
|
||||
@@ -473,7 +477,17 @@ class TimeEntryController extends Controller
|
||||
|
||||
}
|
||||
|
||||
$project = $timeEntry->project;
|
||||
$task = $timeEntry->task;
|
||||
|
||||
$timeEntry->delete();
|
||||
|
||||
if ($project !== null) {
|
||||
RecalculateSpentTimeForProject::dispatch($project);
|
||||
}
|
||||
if ($task !== null) {
|
||||
RecalculateSpentTimeForTask::dispatch($task);
|
||||
}
|
||||
$success->push($id);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user