This commit is contained in:
annampak 2017-10-27 10:48:53 +03:00
parent a45a3efdcf
commit cd294f2abf
4 changed files with 16 additions and 12 deletions

View File

@ -133,7 +133,7 @@ myFunction() {
SaveNewDmp(){
console.log(this.dmp, this.dmp.projectsDropDownKey);
//this.http.post('http://someurl', JSON.stringify(this.project))
this.serverService.createDmpForProject(this.dmp, this.dmp.projectsDropDownKey)
this.serverService.createDmpForProject(this.dmp)
.subscribe(
response =>{
console.log("response");

View File

@ -64,7 +64,7 @@
<form #newProjectForm="ngForm" (ngSubmit)="SaveNewDmp()">
<div class="form-group">
<label for="recipient-name" class="col-form-label">Project:</label>
<select class="form-control" [id]="projectsDropDownKey" [(ngModel)]="dmp.projectsDropDownKey" [name]="projectsDropDown" #datasetfield>
<select class="form-control" [id]="projectsDropDownKey" [(ngModel)]="dmp.id" [name]="projectsDropDown" #datasetfield>
<option *ngFor="let opt of projectsDropDown.options" [value]="opt.key">{{opt.value}}</option>
</select>
</div>

View File

@ -15,16 +15,16 @@ export class RestBase {
this.xml2jsonOBJ = new X2JS();
}
// protocol: string = "http";
// hostname: string ="dl010.madgik.di.uoa.gr" ;//"localhost";//"dl010.madgik.di.uoa.gr";//
// port: number = 8080;//8080;//
// webappname: string = "dmp-backend-1";//"dmp-backend-new";//
protocol: string = "http";
hostname: string ="dionysus.di.uoa.gr" ;
port: number = 7070;
hostname: string ="dl010.madgik.di.uoa.gr" ;//"localhost";//"dl010.madgik.di.uoa.gr";//
port: number = 8080;//8080;//
webappname: string = "dmp-backend";//"dmp-backend-new";//
// protocol: string = "http";
// hostname: string ="dionysus.di.uoa.gr" ;
// port: number = 7070;
// webappname: string = "dmp-backend";//"dmp-backend-new";//
proxyPath : string = this.protocol+"://"+this.hostname+":"+this.port+"/"+this.webappname+"/proxy/";
loginPath : string = this.protocol+"://"+this.hostname+":"+this.port+"/"+this.webappname+"/login/";

View File

@ -104,13 +104,17 @@ export class ServerService {
return this.restBase.get("dmp/getofuser");
}
public createDmpForProject(data:any, projectid: string){
public createDmpForProject2(data:any, projectid: string){
//return this.restBase.post("dmp/createforproject", data);
return this.restBase.postWithParams('dmp/createforproject', data,
new HttpParams().set('projectid', projectid)
return this.restBase.postWithParams('dmp/create', data,
new HttpParams().set('id', projectid)
)
}
public createDmpForProject(data:any){
return this.restBase.post("dmp/create", data);
}
logOut() {