Add ListEvidence method and improve error handling in UploadAttachment
This commit is contained in:
parent
d8354871a4
commit
bd8639c90b
1 changed files with 3 additions and 3 deletions
|
@ -38,14 +38,14 @@
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
$operators = EvidenceManager::getEvidenceRecords($limit, $page);
|
$evidenceRecords = EvidenceManager::getEvidenceRecords($limit, $page);
|
||||||
}
|
}
|
||||||
catch (DatabaseOperationException $e)
|
catch (DatabaseOperationException $e)
|
||||||
{
|
{
|
||||||
throw new RequestException('Internal Server Error: Unable to retrieve operators', 500, $e);
|
throw new RequestException('Internal Server Error: Unable to retrieve evidence', 500, $e);
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = array_map(fn($op) => $op->toArray(), $operators);
|
$result = array_map(fn($evidence) => $evidence->toArray(), $evidenceRecords);
|
||||||
self::successResponse($result);
|
self::successResponse($result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue