Version 4.7.0
This commit is contained in:
1 parent
517a5e1f70
commit
8ba7d43898
1933 files changed
+65613
-11332
No files matched your search
@@ -570,7 +570,7 @@ class _members extends \IPS\Api\Controller
|
||||
{
|
||||
$classToFollow = 'IPS\\' . \IPS\Request::i()->followApp . '\\' . mb_ucfirst( \IPS\Request::i()->followArea );
|
||||
|
||||
if( !class_exists( $classToFollow ) or !array_key_exists( \IPS\Request::i()->follow_app, \IPS\Application::applications() ) )
|
||||
if( !class_exists( $classToFollow ) or !array_key_exists( \IPS\Request::i()->followApp, \IPS\Application::applications() ) )
|
||||
{
|
||||
throw new \OutOfRangeException;
|
||||
}
|
||||
@@ -1193,19 +1193,15 @@ class _members extends \IPS\Api\Controller
|
||||
|
||||
/**
|
||||
* POST /core/members/{id}/achievements/{badge}/awardbadge
|
||||
* Acknowledge a warning
|
||||
* Award a badge
|
||||
*
|
||||
* @param int $id ID Number
|
||||
* @reqapiparam int $badgeId Badge to award
|
||||
* @param int $logId The ID number of the log in core_achievements_log which will tell us specifically what ACTION caused this (eg what post was made)
|
||||
* @param int $ruleId The ID number of the rule which matched that action which caused this badge to be awarded
|
||||
* @param array $actor If member is 'subject', 'other' or both
|
||||
* @param int $recognize The ID of the recognize table row (optional)
|
||||
* @return \IPS\Member
|
||||
* @throws 2C292/M INVALID_BADGE The badge could not be found //TODo error code
|
||||
* @throws 2C292/N INVALID_ID The member could not be found //TODo error code
|
||||
* @throws 2C292/13 INVALID_BADGE The badge could not be found
|
||||
* @throws 2C292/14 INVALID_ID The member could not be found
|
||||
*/
|
||||
public function POSTitem_achievements_awardbadge( int $id, int $badgeId, int $logId, int $ruleId, array $actor, int $recognize=0 ): \IPS\Api\Response
|
||||
public function POSTitem_achievements_awardbadge( int $id, int $badgeId ): \IPS\Api\Response
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -1223,15 +1219,15 @@ class _members extends \IPS\Api\Controller
|
||||
}
|
||||
catch( \OutOfRangeException $e )
|
||||
{
|
||||
throw new \IPS\Api\Exception( 'INVALID_BADGE', '2C292/W', 404 ); //TODO error code
|
||||
throw new \IPS\Api\Exception( 'INVALID_BADGE', '2C292/13', 404 );
|
||||
}
|
||||
|
||||
$member->awardBadge($id, $badgeId, $logId,$ruleId,$actor,$recognize);
|
||||
$member->awardBadge($badge, 0, 0, ['subject'] );
|
||||
return new \IPS\Api\Response( 200, $member->apiOutput( $this->member ) );
|
||||
}
|
||||
catch ( \OutOfRangeException $e )
|
||||
{
|
||||
throw new \IPS\Api\Exception( 'INVALID_ID', '2C292/N', 404 ); //TODO error code
|
||||
throw new \IPS\Api\Exception( 'INVALID_ID', '2C292/14', 404 );
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user