Skip to content
Next
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Minds Backend - Engine
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
131
Issues
131
List
Boards
Labels
Service Desk
Milestones
Merge Requests
27
Merge Requests
27
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Minds
Minds Backend - Engine
Commits
a4b616ff
Commit
a4b616ff
authored
16 minutes ago
by
Mark Harding
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(feat): use hydrated entity and export
parent
ecb32ca4
epic/ReportingAndModeration
1 merge request
!100
Epic/reporting and moderation
Pipeline
#61726798
passed with stages
in 4 minutes and 23 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
5 deletions
+17
-5
summons.php
Controllers/api/v2/moderation/summons.php
+6
-4
Manager.php
Core/Reports/Manager.php
+11
-1
No files found.
Controllers/api/v2/moderation/summon.php
→
Controllers/api/v2/moderation/summon
s
.php
View file @
a4b616ff
...
...
@@ -15,7 +15,7 @@ use Minds\Core\Reports\Summons\Summon as SummonEntity;
use
Minds\Core\Session
;
use
Minds\Interfaces
;
class
summon
implements
Interfaces\Api
class
summon
s
implements
Interfaces\Api
{
/**
* Equivalent to HTTP GET method
...
...
@@ -43,8 +43,8 @@ class summon implements Interfaces\Api
/** @var Manager $summonsManager */
$summonsManager
=
Di
::
_
()
->
get
(
'Moderation\Summons\Manager'
);
/** @var Reports
Repository $reportsRepository
*/
$reports
Repository
=
Di
::
_
()
->
get
(
'Reports\Repository
'
);
/** @var Reports
Manager $reportsManager
*/
$reports
Manager
=
Di
::
_
()
->
get
(
'Moderation\Manager
'
);
$summon
=
new
SummonEntity
();
try
{
...
...
@@ -75,7 +75,9 @@ class summon implements Interfaces\Api
];
if
(
$summon
->
isAccepted
())
{
$response
[
'report'
]
=
$reportsRepository
->
get
(
$summon
->
getReportUrn
());
$response
[
'report'
]
=
$reportsManager
->
getReport
(
$summon
->
getReportUrn
())
->
export
();
}
return
Factory
::
response
(
$response
);
...
...
This diff is collapsed.
Click to expand it.
Core/Reports/Manager.php
View file @
a4b616ff
...
...
@@ -63,9 +63,19 @@ class Manager
return
$response
;
}
/**
* Return a single report
* @param string $urn
* @return Report
*/
public
function
getReport
(
$urn
)
{
return
$this
->
repository
->
get
(
$urn
);
$report
=
$this
->
repository
->
get
(
$urn
);
$entity
=
$this
->
entitiesResolver
->
single
(
(
new
Urn
())
->
setUrn
(
$report
->
getEntityUrn
())
);
$report
->
setEntity
(
$entity
);
return
$report
;
}
/**
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment