1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-17 16:53:34 +00:00

Validation of forms

This commit is contained in:
Kyle Spearrin
2016-09-22 12:50:27 -04:00
parent 24db219dc3
commit 985dba1555
16 changed files with 74 additions and 11 deletions

View File

@@ -14,6 +14,11 @@
$scope.savePromise = null;
$scope.save = function (model) {
if (!model.name) {
toastr.error('Name is required.');
return;
}
$scope.savePromise = $q.when(folderService.encrypt(model)).then(function (folderModel) {
var folder = new Folder(folderModel, true);
return $q.when(folderService.saveWithServer(folder)).then(function (folder) {