]> git.mxchange.org Git - friendica.git/commitdiff
Apply suggestions
authormarcin mikołajczak <git@mkljczk.pl>
Sun, 20 Feb 2022 13:10:57 +0000 (14:10 +0100)
committermarcin mikołajczak <git@mkljczk.pl>
Sun, 20 Feb 2022 13:10:57 +0000 (14:10 +0100)
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
src/Model/Group.php
src/Module/Api/Mastodon/Lists/Accounts.php

index da77335f12ed944a515bf26d74be052aadde0644..fa41d26467fc704034b706306a7ee81975b69467 100644 (file)
@@ -358,14 +358,18 @@ class Group
                        throw new HTTPException\NotFoundException('Group not found.');
                }
 
+               $contactIds = [];
+
                foreach ($contacts as $cid) {
                        $cdata = Contact::getPublicAndUserContactID($cid, $group['uid']);
                        if (empty($cdata['user'])) {
                                throw new HTTPException\NotFoundException('Invalid contact.');
                        }
 
-                       DBA::delete('group_member', ['gid' => $gid, 'contact-id' => $cdata['user']]);
+                       $contactIds[] = $cdata['user'];
                }
+
+               DBA::delete('group_member', ['gid' => $gid, 'contact-id' => $contactIds]);
        }
 
        /**
index 8d27207fc4762b933d2288283bbdd7e298c74df3..413cacae29895e8614efaf94ce2c6d65edc4033f 100644 (file)
@@ -45,6 +45,7 @@ class Accounts extends BaseApi
                if (empty($request['account_ids']) || empty($this->parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
+
                return Group::removeMembers($this->parameters['id'], $request['account_ids']);
        }
 
@@ -59,6 +60,7 @@ class Accounts extends BaseApi
                if (empty($request['account_ids']) || empty($this->parameters['id'])) {
                        DI::mstdnError()->UnprocessableEntity();
                }
+
                return Group::addMembers($this->parameters['id'], $request['account_ids']);
        }