Skip to content
Snippets Groups Projects
Verified Commit 9d94e691 authored by Damien's avatar Damien
Browse files

FEAT #7721 Fix label control

parent 56841d4e
No related branches found
No related tags found
No related merge requests found
......@@ -112,6 +112,12 @@ class ContactGroupController
return $response->withStatus(400)->withJson(['errors' => 'Bad Request']);
}
$user = UserModel::getByUserId(['select' => ['id'], 'userId' => $GLOBALS['userId']]);
$existingGroup = ContactGroupModel::get(['select' => [1], 'where' => ['label = ?', 'owner = ?'], 'data' => [$data['label'], $user['id']]]);
if (!empty($existingGroup)) {
return $response->withStatus(400)->withJson(['errors' => _CONTACTS_GROUP_LABEL_ALREADY_EXISTS]);
}
$data['id'] = $aArgs['id'];
$data['public'] = $data['public'] ? 'true' : 'false';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment