Version 4.7.8
This commit is contained in:
1 parent
7b7404e741
commit
fd22d99e69
688 files changed
+19814
-10890
No files matched your search
@@ -33,7 +33,7 @@ class _DeleteAttachment
|
||||
/*
|
||||
* Mutation arguments
|
||||
*/
|
||||
public function args()
|
||||
public function args(): array
|
||||
{
|
||||
return [
|
||||
'id' => TypeRegistry::nonNull( TypeRegistry::id() ),
|
||||
@@ -58,7 +58,7 @@ class _DeleteAttachment
|
||||
* @param mixed Value passed into this resolver
|
||||
* @param array Arguments
|
||||
* @param array Context values
|
||||
* @return \IPS\forums\Forum
|
||||
* @return bool
|
||||
*/
|
||||
public function resolve($val, $args, $context, $info)
|
||||
{
|
||||
@@ -69,7 +69,7 @@ class _DeleteAttachment
|
||||
}
|
||||
catch ( \UnderflowException $e )
|
||||
{
|
||||
throw new \IPS\Api\GraphQL\SafeException( 'NO_ATTACHMENT', '2C398/1', 404 );
|
||||
throw new \IPS\Api\GraphQL\SafeException( 'NO_ATTACHMENT', 'GQL/0004/1', 404 );
|
||||
}
|
||||
|
||||
/* Delete the maps - Only do this for attachments that have actually been saved (if they haven't been saved, there's nothing in core_attachments_map for us to delete */
|
||||
@@ -92,7 +92,7 @@ class _DeleteAttachment
|
||||
/* If the attachment hasn't been claimed yet, it should only be deletable by the person who uploaded it */
|
||||
if( $attachment['attach_member_id'] != \IPS\Member::loggedIn()->member_id )
|
||||
{
|
||||
throw new \IPS\Api\GraphQL\SafeException( 'CANNOT_DELETE_OTHERS_ATTACHMENTS', '2C398/2', 403 );
|
||||
throw new \IPS\Api\GraphQL\SafeException( 'CANNOT_DELETE_OTHERS_ATTACHMENTS', 'GQL/0004/2', 403 );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user