Skip to content
Projects
Groups
Snippets
Help
Sign in / Register
Toggle navigation
Minds Backend - Engine
Project overview
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
297
Merge Requests
42
CI / CD
Security & Compliance
Packages
Wiki
Snippets
Members
Collapse sidebar
Close sidebar
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Minds
Minds Backend - Engine
Commits
5f0bdfaa
Commit
5f0bdfaa
authored
1 hour ago
by
Emiliano Balbuena
Browse files
Options
Download
(feat): Hydrate referrer
parent
3454e3c8
goal/withdrawals-approval
1 merge request
!393
(feat): Withdrawal status support
Pipeline
#95662660
failed with stages
in 2 minutes and 50 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
4 deletions
+30
-4
Core/Rewards/Withdraw/Delegates/RequestHydrationDelegate.php
View file @
5f0bdfaa
...
...
@@ -25,7 +25,11 @@ class RequestHydrationDelegate
return
$request
;
}
$user
=
new
User
(
$userGuid
);
try
{
$user
=
new
User
(
$userGuid
);
}
catch
(
Exception
$exception
)
{
$user
=
null
;
}
return
$request
->
setUser
(
$user
);
...
...
@@ -33,10 +37,30 @@ class RequestHydrationDelegate
public
function
hydrateForAdmin
(
Request
$request
)
{
// TBD
if
(
!
$request
->
getUser
())
{
$request
=
$this
->
hydrate
(
$request
);
if
(
!
$request
->
getUser
())
{
return
$request
;
}
}
// TODO: Hydrate referrer
$referrerGuid
=
$request
->
getUser
()
->
referrer
;
return
$request
;
if
(
!
$referrerGuid
)
{
return
$request
;
}
try
{
$user
=
new
User
(
$referrerGuid
);
}
catch
(
Exception
$exception
)
{
// Faux user in case of banned/deleted accounts
$user
=
new
User
();
$user
->
guid
=
$referrerGuid
;
$user
->
username
=
$referrerGuid
;
}
return
$request
->
setReferrer
(
$user
);
}
}
This diff is collapsed.
Core/Rewards/Withdraw/Request.php
View file @
5f0bdfaa
...
...
@@ -28,6 +28,8 @@ use Minds\Traits\MagicAttributes;
* @method Request setTimestamp(int $timestamp)
* @method User|null getUser()
* @method Request setUser(User|null $user)
* @method User|null getReferrer()
* @method Request setReferrer(User|null $referrer)
*/
class
Request
implements
JsonSerializable
{
...
...
This diff is collapsed.
Please
register
or
sign in
to comment