Fix username and groupname min length
This commit is contained in:
@@ -791,12 +791,13 @@ angular.module('Application').service('Client', ['$http', 'md5', 'Notification',
|
||||
|
||||
Client.prototype.createUser = function (username, email, displayName, sendInvite, callback) {
|
||||
var data = {
|
||||
username: username,
|
||||
email: email,
|
||||
displayName: displayName,
|
||||
invite: !!sendInvite
|
||||
};
|
||||
|
||||
if (username !== null) data.username = username;
|
||||
|
||||
post('/api/v1/users', data).success(function(data, status) {
|
||||
if (status !== 201 || typeof data !== 'object') return callback(new ClientError(status, data));
|
||||
callback(null, data);
|
||||
|
||||
@@ -164,7 +164,7 @@
|
||||
<small ng-show="groupAddForm.name.$error.maxlength">The name is too long</small>
|
||||
<small ng-show="!groupAddForm.name.$dirty && groupAdd.error.name">{{ groupAdd.error.name }}</small>
|
||||
</div>
|
||||
<input type="text" class="form-control" ng-model="groupAdd.name" id="groupAddName" name="name" ng-maxlength="200" ng-minlength="2" required autofocus>
|
||||
<input type="text" class="form-control" ng-model="groupAdd.name" id="groupAddName" name="name" ng-maxlength="200" ng-minlength="1" required autofocus>
|
||||
</div>
|
||||
<input class="hide" type="submit" ng-disabled="groupAddForm.$invalid || groupAdd.busy"/>
|
||||
</form>
|
||||
|
||||
@@ -87,7 +87,7 @@ angular.module('Application').controller('UsersController', ['$scope', '$locatio
|
||||
$scope.useradd.error.username = null;
|
||||
$scope.useradd.error.displayName = null;
|
||||
|
||||
Client.createUser($scope.useradd.username, $scope.useradd.email, $scope.useradd.displayName, $scope.useradd.sendInvite, function (error) {
|
||||
Client.createUser($scope.useradd.username || null, $scope.useradd.email, $scope.useradd.displayName, $scope.useradd.sendInvite, function (error) {
|
||||
$scope.useradd.busy = false;
|
||||
|
||||
if (error && error.statusCode === 409) {
|
||||
|
||||
Reference in New Issue
Block a user