Commit e57edcd0 authored by Moises Sacal's avatar Moises Sacal
Browse files

updating link with no permissions for issue #21

parent 1afe3e5e
...@@ -2,7 +2,7 @@ declare var module; ...@@ -2,7 +2,7 @@ declare var module;
declare var sails, Model; declare var sails, Model;
declare var _; declare var _;
import {Observable} from 'rxjs/Rx'; import {Observable} from 'rxjs';
import 'rxjs/add/operator/map'; import 'rxjs/add/operator/map';
declare var BrandingService, WorkspaceService, LabarchivesService; declare var BrandingService, WorkspaceService, LabarchivesService;
...@@ -161,6 +161,7 @@ export module Controllers { ...@@ -161,6 +161,7 @@ export module Controllers {
.flatMap(response => { .flatMap(response => {
sails.log.debug('insertNode'); sails.log.debug('insertNode');
sails.log.debug(response); sails.log.debug(response);
if (response && response['tree-tools']) {
const tree = response['tree-tools']; const tree = response['tree-tools'];
const node = tree['node']; const node = tree['node'];
metadataContent = ` metadataContent = `
...@@ -176,6 +177,7 @@ export module Controllers { ...@@ -176,6 +177,7 @@ export module Controllers {
this.config.key, info['id'], nbId, node['tree-id'], partType, metadataContent this.config.key, info['id'], nbId, node['tree-id'], partType, metadataContent
); );
return Observable.fromPromise(insertNode); return Observable.fromPromise(insertNode);
} else return Observable.throwError(new Error('cannot insert node'));
}) })
.flatMap(response => { .flatMap(response => {
if (recordMetadata.workspaces) { if (recordMetadata.workspaces) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment