Browse Source

Fix batch update sortorder

pull/3/head
Wahyu Ramadhan 1 year ago
parent
commit
d850aef744
  1. 3
      app/Http/Controllers/ActivityController.php

3
app/Http/Controllers/ActivityController.php

@ -330,6 +330,9 @@ class ActivityController extends Controller
$activityToUpdate = $activity->firstWhere('id', $entity['data']['id']);
$entity['data']['name'] = $entity['data']['text'];
$entity['data']['persentase_progress'] = $entity['data']['progress'] * 100;
if (isset($entity['data']['target'])) {
$this->updateOrder($entity['data']['id'], $entity['data']['target']);
}
if(!$activityToUpdate->update($entity['data']))
return response()->json(['status' => 'failed', 'message' => 'Failed to update activity !', 'code' => 500], 500);
$updatedJobsDone = $activityToUpdate->jobs_done;

Loading…
Cancel
Save