Skip to content

Commit 6af1d60

Browse files
committed
update error messages
Signed-off-by: samin-z <samin.zavarkesh@gmail.com>
1 parent ddd884f commit 6af1d60

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

lib/Service/ColumnTypes/UsergroupBusiness.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,16 @@ public function validateValue(mixed $value, Column $column, string $userId, int
4444
throw new BadRequestError('Invalid value for usergroup column');
4545
}
4646

47-
foreach ($value as $circleEntry) {
48-
if (!isset($circleEntry['id']) || !is_string($circleEntry['id'])) {
49-
throw new BadRequestError('Invalid circle id');
47+
foreach ($value as $userGroupEntry) {
48+
if (!isset($userGroupEntry['id']) || !is_string($userGroupEntry['id'])) {
49+
throw new BadRequestError('Invalid value for usergroup id');
5050
}
51-
if (!isset($circleEntry['type']) || !is_int($circleEntry['type'])) {
51+
if (!isset($userGroupEntry['type']) || !is_int($userGroupEntry['type'])) {
5252
throw new BadRequestError('Invalid usergroup type');
5353
}
54-
if ($circleEntry['type'] === UsergroupType::CIRCLE) {
55-
if (!$this->circleHelper->circleExists($circleEntry['id'], $userId)) {
56-
throw new BadRequestError("User does not belong to circle: {$circleEntry['displayName']}");
54+
if ($userGroupEntry['type'] === UsergroupType::CIRCLE) {
55+
if (!$this->circleHelper->circleExists($userGroupEntry['id'], $userId)) {
56+
throw new BadRequestError('Circle not found');
5757
}
5858
}
5959
}

0 commit comments

Comments
 (0)