Skip to content

Commit 44ef39e

Browse files
committed
Merge remote-tracking branch 'origin/develop'
2 parents 0ea9c06 + e05a0ef commit 44ef39e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

app/Http/Controllers/Api/UploadedFilesController.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,12 @@ public function destroy($object_type, $id, $file_id) : JsonResponse
193193

194194

195195
// Check for the file
196-
$log = Actionlog::find($file_id)->where('item_type', self::$map_object_type[$object_type])
197-
->where('item_id', $object->id)->first();
196+
$log = Actionlog::query()
197+
->where('id', $file_id)
198+
->where('action_type', 'uploaded')
199+
->where('item_type', self::$map_object_type[$object_type])
200+
->where('item_id', $object->id)
201+
->first();
198202

199203
if ($log) {
200204
// Check the file actually exists, and delete it
@@ -213,4 +217,4 @@ public function destroy($object_type, $id, $file_id) : JsonResponse
213217
return response()->json(Helper::formatStandardApiResponse('error', null, trans_choice('general.file_upload_status.delete.error', 1)), 500);
214218

215219
}
216-
}
220+
}

0 commit comments

Comments
 (0)