mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-21 14:29:34 +00:00
no message
This commit is contained in:
1 parent
2e8dd25ab8
commit
47a31f5c3a
2 files changed
+25
-1
No files matched your search
@@ -162,13 +162,20 @@ class SubTaskController extends Controller
|
||||
{
|
||||
$subtask = SubTask::find($id);
|
||||
|
||||
// ak je Master task v stave ukončený, nedovolime update
|
||||
// ak je sub task v stave ukončený, nedovolime update
|
||||
if ($subtask->is_finished == 1) {
|
||||
return response()->json([
|
||||
'message' => 'Cannot update subtask with is_finished 1.',
|
||||
], 400);
|
||||
}
|
||||
|
||||
// ak chcem ukoncit subtask, ktory nema natrackovany cas, tak to nedovolim
|
||||
if (isset($request->all()['data']['is_finished']) && $request->all()['data']['is_finished'] == 1 && $subtask->timesheets->count() == 0) {
|
||||
return response()->json([
|
||||
'message' => 'Cannot finish subtask with untracked time.',
|
||||
], 400);
|
||||
}
|
||||
|
||||
$validator = Validator::make($request->all(), [
|
||||
'data.employee_id' => 'required',
|
||||
'data.duration' => 'required',
|
||||
|
||||
Reference in new issue
Block a user