Browse Source

Merge pull request 'Fix report activity after update' (#127) from dev-wahyu into staging

Reviewed-on: ordo/adw-backend#127
pull/3/head
ibnu 1 year ago
parent
commit
aa1ec2fff1
  1. 2
      app/Http/Controllers/ActivityController.php

2
app/Http/Controllers/ActivityController.php

@ -327,8 +327,10 @@ class ActivityController extends Controller
if ($entity['entity'] == "task") {
$activityToUpdate = $activity->firstWhere('id', $entity['data']['id']);
$entity['data']['name'] = $entity['data']['text'];
$entity['data']['persentase_progress'] = $entity['data']['progress'] * 100;
if(!$activityToUpdate->update($entity['data']))
return response()->json(['status' => 'failed', 'message' => 'Failed to update activity !', 'code' => 500], 500);
$updatedJobsDone = $activityToUpdate->jobs_done;
} else if ($entity['entity'] == "link"){
$linkToUpdate = $link->firstWhere('id', $entity['data']['id']);
if(!$linkToUpdate->update($entity['data']))

Loading…
Cancel
Save