diff --git a/dmp-frontend/src/app/dmps/dmp-routing.module.ts b/dmp-frontend/src/app/dmps/dmp-routing.module.ts index e4af83e00..6508ef00d 100644 --- a/dmp-frontend/src/app/dmps/dmp-routing.module.ts +++ b/dmp-frontend/src/app/dmps/dmp-routing.module.ts @@ -6,7 +6,7 @@ import { DynamicFormComponent } from '../form/dynamic-form.component'; import { AuthGuard } from '../guards/auth.guard'; const projectsRoutes: Routes = [ - { path: 'tabs/dmps', component: DmpComponent }, + //{ path: 'tabs/dmps', component: DmpComponent }, { path: 'dynamic-form/:id', component: DynamicFormComponent, canActivate: [AuthGuard] } ]; diff --git a/dmp-frontend/src/app/projects/project-routing.module.ts b/dmp-frontend/src/app/projects/project-routing.module.ts index 1ed32d2ab..4cd05d95f 100644 --- a/dmp-frontend/src/app/projects/project-routing.module.ts +++ b/dmp-frontend/src/app/projects/project-routing.module.ts @@ -7,7 +7,7 @@ import { DynamicFormComponent } from '../form/dynamic-form.component'; import { AuthGuard } from '../guards/auth.guard'; const projectsRoutes: Routes = [ - { path: 'tabs/projects', component: ProjectsComponent }, // canActivate: [AuthGuard] + // { path: 'tabs/projects', component: ProjectsComponent }, // canActivate: [AuthGuard] { path: 'dynamic-form/:id', component: DynamicFormComponent, canActivate: [AuthGuard] } ]; diff --git a/dmp-frontend/src/app/services/rest-base.ts b/dmp-frontend/src/app/services/rest-base.ts index 7e07858cd..9d9618591 100644 --- a/dmp-frontend/src/app/services/rest-base.ts +++ b/dmp-frontend/src/app/services/rest-base.ts @@ -52,6 +52,12 @@ export class RestBase { return this.http.post(this.restPath + path, JSON.stringify(data), options); } + public postWithParams(path : string, data : any, params: HttpParams) { + var options = this.createOptions(); + options.params = params; + return this.http.post(this.restPath + path, JSON.stringify(data), options); + } + private createOptions(){ var token = this.tokenService.getToken(); diff --git a/dmp-frontend/src/app/services/server.service.ts b/dmp-frontend/src/app/services/server.service.ts index d7eb6ef8a..11ba7a601 100644 --- a/dmp-frontend/src/app/services/server.service.ts +++ b/dmp-frontend/src/app/services/server.service.ts @@ -105,10 +105,10 @@ export class ServerService { } public createDmpForProject(data:any, projectid: string){ - return this.restBase.post("dmp/createforproject", data); - // return this.restBase.post('dmp/createforproject', data, { - // params: new HttpParams().set('projectid', projectid), - // }) + //return this.restBase.post("dmp/createforproject", data); + return this.restBase.postWithParams('dmp/createforproject', data, + new HttpParams().set('projectid', projectid) + ) } diff --git a/dmp-frontend/src/app/tabs/tabs-routing.module.ts b/dmp-frontend/src/app/tabs/tabs-routing.module.ts index fee546906..c8c4eb1fe 100644 --- a/dmp-frontend/src/app/tabs/tabs-routing.module.ts +++ b/dmp-frontend/src/app/tabs/tabs-routing.module.ts @@ -3,9 +3,13 @@ import { RouterModule, Routes } from '@angular/router'; import { TabComponent } from './tabs.component'; import { AuthGuard } from '../guards/auth.guard'; +import { ProjectsComponent } from '../projects/projects.component'; +import { DmpComponent } from '../dmps/dmp.component'; const tabsRoutes: Routes = [ { path: 'tabs', component: TabComponent, canActivate: [AuthGuard] }, + { path: 'tabs/projects', component: ProjectsComponent }, // canActivate: [AuthGuard] + { path: 'tabs/dmps', component: DmpComponent } ]; @NgModule({