1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-09-14 02:08:50 +02:00

pull only writable collections when editing

This commit is contained in:
Kyle Spearrin 2017-08-30 15:58:51 -04:00
parent f019dc6575
commit 63033ca12d
4 changed files with 4 additions and 4 deletions

View File

@ -100,7 +100,7 @@
_service.collections = $resource(_apiUri + '/organizations/:orgId/collections/:id', {}, {
get: { method: 'GET', params: { id: '@id', orgId: '@orgId' } },
getDetails: { url: _apiUri + '/organizations/:orgId/collections/:id/details', method: 'GET', params: { id: '@id', orgId: '@orgId' } },
listMe: { url: _apiUri + '/collections', method: 'GET', params: {} },
listMe: { url: _apiUri + '/collections?writeOnly=:writeOnly', method: 'GET', params: { writeOnly: '@writeOnly' } },
listOrganization: { method: 'GET', params: { orgId: '@orgId' } },
listUsers: { url: _apiUri + '/organizations/:orgId/collections/:id/users', method: 'GET', params: { id: '@id', orgId: '@orgId' } },
post: { method: 'POST', params: { orgId: '@orgId' } },

View File

@ -39,7 +39,7 @@
return;
}
apiService.collections.listMe(function (response) {
apiService.collections.listMe({ writeOnly: true }, function (response) {
var collections = [];
for (var i = 0; i < response.Data.length; i++) {
if (response.Data[i].OrganizationId !== cipher.OrganizationId || response.Data[i].ReadOnly) {

View File

@ -51,7 +51,7 @@
$scope.organizations = orgs;
apiService.collections.listMe(function (response) {
apiService.collections.listMe({ writeOnly: true }, function (response) {
var collections = [];
for (var i = 0; i < response.Data.length; i++) {
if (response.Data[i].ReadOnly) {

View File

@ -8,7 +8,7 @@
$scope.loading = true;
$scope.$on('$viewContentLoaded', function () {
var collectionPromise = apiService.collections.listMe({}, function (collections) {
var collectionPromise = apiService.collections.listMe({ writeOnly: false }, function (collections) {
var decCollections = [];
for (var i = 0; i < collections.Data.length; i++) {