From 7257f187324a59864d7db29c72fdb63f12900f40 Mon Sep 17 00:00:00 2001 From: Danijel Anđelković Date: Fri, 29 Apr 2022 21:01:03 +0200 Subject: Promenio folder tako da pokazuje razlicite kategorije kao tabove. --- frontend/src/app/_services/experiments.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'frontend/src/app/_services/experiments.service.ts') diff --git a/frontend/src/app/_services/experiments.service.ts b/frontend/src/app/_services/experiments.service.ts index 0d0d372b..bdaf62a7 100644 --- a/frontend/src/app/_services/experiments.service.ts +++ b/frontend/src/app/_services/experiments.service.ts @@ -1,7 +1,7 @@ import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; import { Observable } from 'rxjs'; -import { Configuration } from '../configuration.service'; +import { Configuration } from './configuration.service'; import Experiment from '../_data/Experiment'; import { AuthService } from './auth.service'; -- cgit v1.2.3 From dcc2d82409ef778abbed9d290ed35413a6c52a73 Mon Sep 17 00:00:00 2001 From: Nevena Bojovic Date: Mon, 2 May 2022 19:43:17 +0200 Subject: Funkcionalnost experiment - doradjeno. --- .../column-table/column-table.component.html | 1 + .../src/app/_elements/folder/folder.component.html | 1 + frontend/src/app/_elements/folder/folder.component.ts | 16 +--------------- .../app/_pages/experiment/experiment.component.html | 6 +++--- .../src/app/_pages/experiment/experiment.component.ts | 19 +++++++++++-------- frontend/src/app/_services/experiments.service.ts | 4 ++++ 6 files changed, 21 insertions(+), 26 deletions(-) (limited to 'frontend/src/app/_services/experiments.service.ts') diff --git a/frontend/src/app/_elements/column-table/column-table.component.html b/frontend/src/app/_elements/column-table/column-table.component.html index 42c43138..050f9644 100644 --- a/frontend/src/app/_elements/column-table/column-table.component.html +++ b/frontend/src/app/_elements/column-table/column-table.component.html @@ -1,3 +1,4 @@ +{{forExperiment.name}}
diff --git a/frontend/src/app/_elements/folder/folder.component.html b/frontend/src/app/_elements/folder/folder.component.html index 36f70c97..404ba302 100644 --- a/frontend/src/app/_elements/folder/folder.component.html +++ b/frontend/src/app/_elements/folder/folder.component.html @@ -1,3 +1,4 @@ +{{forExperiment.name}}
diff --git a/frontend/src/app/_elements/folder/folder.component.ts b/frontend/src/app/_elements/folder/folder.component.ts index eae99725..a1cd6075 100644 --- a/frontend/src/app/_elements/folder/folder.component.ts +++ b/frontend/src/app/_elements/folder/folder.component.ts @@ -9,7 +9,6 @@ import { FormDatasetComponent } from '../form-dataset/form-dataset.component'; import Experiment from 'src/app/_data/Experiment'; import { ExperimentsService } from 'src/app/_services/experiments.service'; import { PredictorsService } from 'src/app/_services/predictors.service'; -import { ExperimentComponent } from 'src/app/_pages/experiment/experiment.component'; @Component({ selector: 'app-folder', @@ -20,7 +19,7 @@ export class FolderComponent implements OnInit { @ViewChild(FormDatasetComponent) formDataset?: FormDatasetComponent; - @ViewChild(ExperimentComponent) formExperiment?: ExperimentComponent; + @Input() folderName: string = 'Moji podaci'; @@ -72,12 +71,6 @@ export class FolderComponent implements OnInit { this.formDataset!.dataset = this.fileToDisplay; } - displayExp(){ - if(this.type == FolderType.Dataset) - this.formExperiment!.experiment = this.fileToDisplay; - } - - hoverOverFile(i: number) { this.hoveringOverFileIndex = i; if (i != -1) { @@ -90,7 +83,6 @@ export class FolderComponent implements OnInit { } } this.displayFile(); - this.displayExp(); } selectNewFile() { @@ -103,7 +95,6 @@ export class FolderComponent implements OnInit { this.listView = false; this.selectedFileChanged.emit(this.newFile); this.displayFile(); - this.displayExp(); } selectFile(index: number) { @@ -113,7 +104,6 @@ export class FolderComponent implements OnInit { this.listView = false; this.selectedFileChanged.emit(this.selectedFile); this.displayFile(); - this.displayExp(); } createNewFile() { @@ -168,10 +158,6 @@ export class FolderComponent implements OnInit { this.formDataset!.uploadDataset(); } - saveNewExperiment() { - if(this.forExperiment == this.forExperiment) - this.formExperiment!.addNewExperiment(); - } /*calcZIndex(i: number) { let zIndex = (this.files.length - i - 1) diff --git a/frontend/src/app/_pages/experiment/experiment.component.html b/frontend/src/app/_pages/experiment/experiment.component.html index 86faeb2a..ee14c782 100644 --- a/frontend/src/app/_pages/experiment/experiment.component.html +++ b/frontend/src/app/_pages/experiment/experiment.component.html @@ -27,17 +27,17 @@
- +
- +
- +
diff --git a/frontend/src/app/_pages/experiment/experiment.component.ts b/frontend/src/app/_pages/experiment/experiment.component.ts index 2f1b4fd8..8485ded6 100644 --- a/frontend/src/app/_pages/experiment/experiment.component.ts +++ b/frontend/src/app/_pages/experiment/experiment.component.ts @@ -3,8 +3,10 @@ import { StepperSelectionEvent } from '@angular/cdk/stepper'; import { MatStepper } from '@angular/material/stepper'; import Shared from 'src/app/Shared'; import { FolderType } from 'src/app/_data/FolderFile'; -import { TabType } from 'src/app/_elements/folder/folder.component'; +import { FolderComponent, TabType } from 'src/app/_elements/folder/folder.component'; import Experiment from 'src/app/_data/Experiment'; +import { ExperimentsService } from 'src/app/_services/experiments.service'; +import { ModelsService } from 'src/app/_services/models.service'; @Component({ selector: 'app-experiment', @@ -19,22 +21,23 @@ export class ExperimentComponent implements AfterViewInit { event: number = 0; @Input() experiment: Experiment; + @ViewChild("folderDataset") folderDataset?: FolderComponent; + @ViewChild("folderModel") folderModel?: FolderComponent; - - constructor() { - this.experiment = new Experiment(); + constructor(private experimentsService: ExperimentsService, private modelsService: ModelsService) { + this.experiment = new Experiment("exp1"); } - updateExperiment(){ + /*updateExperiment(){ - } + }*/ addNewExperiment(){ - + this.experimentsService.addExperiment(this.experiment).subscribe(()=>{console.log("new Experiment")}); } trainModel(){ - + this.modelsService.trainModel((this.folderModel.selectedFile)._id, this.experiment._id).subscribe(()=>{console.log("pocelo treniranje")}) } stepHeight = this.calcStepHeight(); diff --git a/frontend/src/app/_services/experiments.service.ts b/frontend/src/app/_services/experiments.service.ts index bdaf62a7..ce112498 100644 --- a/frontend/src/app/_services/experiments.service.ts +++ b/frontend/src/app/_services/experiments.service.ts @@ -19,4 +19,8 @@ export class ExperimentsService { getMyExperiments(): Observable { return this.http.get(`${Configuration.settings.apiURL}/experiment/getmyexperiments`, { headers: this.authService.authHeader() }); } + + /*updateExperiment(){ + + }*/ } -- cgit v1.2.3 From b13d6eadd63998f96ce78c3ac55f11564f3d9958 Mon Sep 17 00:00:00 2001 From: Ivan Ljubisavljevic Date: Wed, 4 May 2022 17:40:54 +0200 Subject: Izmenjen Experiment na beku. Uskladjen sa frontom. --- .../api/api/Controllers/ExperimentController.cs | 23 ++++ backend/api/api/Interfaces/IExperimentService.cs | 3 + backend/api/api/Interfaces/IJwtToken.cs | 13 +++ backend/api/api/Models/Experiment.cs | 2 + backend/api/api/Models/IJwtToken.cs | 13 --- backend/api/api/Models/JwtToken.cs | 123 --------------------- backend/api/api/Models/PasswordCrypt.cs | 27 ----- backend/api/api/Services/ExperimentService.cs | 10 ++ backend/api/api/Services/FillAnEmptyDb.cs | 15 +-- backend/api/api/Services/JwtToken.cs | 123 +++++++++++++++++++++ backend/api/api/Services/PasswordCrypt.cs | 27 +++++ frontend/src/app/_services/experiments.service.ts | 6 +- 12 files changed, 210 insertions(+), 175 deletions(-) create mode 100644 backend/api/api/Interfaces/IJwtToken.cs delete mode 100644 backend/api/api/Models/IJwtToken.cs delete mode 100644 backend/api/api/Models/JwtToken.cs delete mode 100644 backend/api/api/Models/PasswordCrypt.cs create mode 100644 backend/api/api/Services/JwtToken.cs create mode 100644 backend/api/api/Services/PasswordCrypt.cs (limited to 'frontend/src/app/_services/experiments.service.ts') diff --git a/backend/api/api/Controllers/ExperimentController.cs b/backend/api/api/Controllers/ExperimentController.cs index 3fa02943..eecbe756 100644 --- a/backend/api/api/Controllers/ExperimentController.cs +++ b/backend/api/api/Controllers/ExperimentController.cs @@ -88,5 +88,28 @@ namespace api.Controllers var experiments=_experimentService.GetMyExperiments(uploaderId); return Ok(experiments); } + + // PUT api//{name} + [HttpPut("{id}")] + [Authorize(Roles = "User")] + public ActionResult Put(string id, [FromBody] Experiment experiment) + { + string uploaderId = getUserId(); + + if (uploaderId == null) + return BadRequest(); + + var existingDataset = _experimentService.GetOneExperiment(uploaderId, id); + + //ne mora da se proverava + if (existingDataset == null) + return NotFound($"Experiment with ID = {id} or user with ID = {uploaderId} not found"); + + experiment.lastUpdated = DateTime.UtcNow; + + _experimentService.Update(uploaderId, id, experiment); + + return Ok($"Experiment with ID = {id} updated"); + } } } diff --git a/backend/api/api/Interfaces/IExperimentService.cs b/backend/api/api/Interfaces/IExperimentService.cs index 47c86046..2a69cff9 100644 --- a/backend/api/api/Interfaces/IExperimentService.cs +++ b/backend/api/api/Interfaces/IExperimentService.cs @@ -8,5 +8,8 @@ namespace api.Services public Experiment Get(string id); public List GetMyExperiments(string id); public Experiment Get(string uploaderId, string name); + Experiment GetOneExperiment(string userId, string name); + void Update(string userId, string id, Experiment experiment); + } } \ No newline at end of file diff --git a/backend/api/api/Interfaces/IJwtToken.cs b/backend/api/api/Interfaces/IJwtToken.cs new file mode 100644 index 00000000..2afb6683 --- /dev/null +++ b/backend/api/api/Interfaces/IJwtToken.cs @@ -0,0 +1,13 @@ +using api.Models.Users; + +namespace api.Models +{ + public interface IJwtToken + { + string GenGuestToken(); + string GenToken(AuthRequest user); + string RenewToken(string existingToken); + string TokenToUsername(string token); + public string TokenToId(string token); + } +} \ No newline at end of file diff --git a/backend/api/api/Models/Experiment.cs b/backend/api/api/Models/Experiment.cs index cfff337c..3af063be 100644 --- a/backend/api/api/Models/Experiment.cs +++ b/backend/api/api/Models/Experiment.cs @@ -17,6 +17,8 @@ namespace api.Models public string[] inputColumns { get; set; } public string outputColumn { get; set; } public string nullValues { get; set; } + public DateTime dateCreated { get; set; } + public DateTime lastUpdated { get; set; } public NullValues[] nullValuesReplacers { get; set; } public ColumnEncoding[] encodings { get; set; } diff --git a/backend/api/api/Models/IJwtToken.cs b/backend/api/api/Models/IJwtToken.cs deleted file mode 100644 index 2afb6683..00000000 --- a/backend/api/api/Models/IJwtToken.cs +++ /dev/null @@ -1,13 +0,0 @@ -using api.Models.Users; - -namespace api.Models -{ - public interface IJwtToken - { - string GenGuestToken(); - string GenToken(AuthRequest user); - string RenewToken(string existingToken); - string TokenToUsername(string token); - public string TokenToId(string token); - } -} \ No newline at end of file diff --git a/backend/api/api/Models/JwtToken.cs b/backend/api/api/Models/JwtToken.cs deleted file mode 100644 index 06b3a666..00000000 --- a/backend/api/api/Models/JwtToken.cs +++ /dev/null @@ -1,123 +0,0 @@ -using System.IdentityModel.Tokens.Jwt; -using System.Security.Claims; -using System.Text; -using api.Models.Users; -using api.Services; -using Microsoft.IdentityModel.Tokens; - -namespace api.Models -{ - public class JwtToken : IJwtToken - { - private readonly IConfiguration _configuration; - private readonly IUserService _userService; - - public JwtToken(IConfiguration configuration, IUserService userService) - { - _configuration = configuration; - _userService = userService; - - } - - public string GenToken(AuthRequest user) - { - var tokenHandler = new JwtSecurityTokenHandler(); - var key = Encoding.ASCII.GetBytes(_configuration.GetSection("AppSettings:JwtToken").Value); - var fullUser = _userService.GetUserByUsername(user.UserName); - var tokenDescriptor = new SecurityTokenDescriptor - { - Subject = new ClaimsIdentity(new[] { new Claim("name", fullUser.Username), - new Claim("role", "User"), - new Claim("id",fullUser._id)}), - Expires = DateTime.UtcNow.AddMinutes(20), - SigningCredentials = new SigningCredentials(new SymmetricSecurityKey(key), SecurityAlgorithms.HmacSha256Signature) - }; - var token = tokenHandler.CreateToken(tokenDescriptor); - return tokenHandler.WriteToken(token); - - } - - public string RenewToken(string existingToken) - { - var userName = TokenToUsername(existingToken); - if (userName == null) - return null; - var authUser = new AuthRequest(); - authUser.UserName = userName; - - return GenToken(authUser); - - } - - public string TokenToUsername(string token) - { - if (token == null) - return null; - var tokenHandler = new JwtSecurityTokenHandler(); - var key = Encoding.ASCII.GetBytes(_configuration.GetSection("AppSettings:JwtToken").Value); - try - { - tokenHandler.ValidateToken(token, new TokenValidationParameters - { - ValidateIssuerSigningKey = true, - IssuerSigningKey = new SymmetricSecurityKey(key), - ValidateIssuer = false, - ValidateAudience = false, - }, out SecurityToken validatedToken); - - var jwtToken = (JwtSecurityToken)validatedToken; - return jwtToken.Claims.First(x => x.Type == "name").Value; - } - catch - { - return null; - } - - } - public string TokenToId(string token) - { - if (token == null) - return null; - var tokenHandler = new JwtSecurityTokenHandler(); - var key = Encoding.ASCII.GetBytes(_configuration.GetSection("AppSettings:JwtToken").Value); - try - { - tokenHandler.ValidateToken(token, new TokenValidationParameters - { - ValidateIssuerSigningKey = true, - IssuerSigningKey = new SymmetricSecurityKey(key), - ValidateIssuer = false, - ValidateAudience = false, - }, out SecurityToken validatedToken); - - var jwtToken = (JwtSecurityToken)validatedToken; - return jwtToken.Claims.First(x => x.Type == "id").Value; - } - catch - { - return null; - } - - } - - public string GenGuestToken() - { - var tokenHandler = new JwtSecurityTokenHandler(); - var key = Encoding.ASCII.GetBytes(_configuration.GetSection("AppSettings:JwtToken").Value); - var tokenDescriptor = new SecurityTokenDescriptor - { - Subject = new ClaimsIdentity(new[] { new Claim("name",""), - new Claim("role", "Guest"), - new Claim("id","")}), - Expires = DateTime.UtcNow.AddMinutes(20), - SigningCredentials = new SigningCredentials(new SymmetricSecurityKey(key), SecurityAlgorithms.HmacSha256Signature) - }; - var token = tokenHandler.CreateToken(tokenDescriptor); - return tokenHandler.WriteToken(token); - - } - - - - } -} diff --git a/backend/api/api/Models/PasswordCrypt.cs b/backend/api/api/Models/PasswordCrypt.cs deleted file mode 100644 index 016fde51..00000000 --- a/backend/api/api/Models/PasswordCrypt.cs +++ /dev/null @@ -1,27 +0,0 @@ -namespace api.Models -{ - public class PasswordCrypt - { - private static int difficulty = 10; - - public static String hashPassword(String password) - { - String salt = BCrypt.Net.BCrypt.GenerateSalt(difficulty); - String passwordHash = BCrypt.Net.BCrypt.HashPassword(password, salt); - - return passwordHash; - } - public static Boolean checkPassword(String plainText,String hash) - { - Boolean verified = false; - - if (hash == null || !hash.StartsWith("$2a$")) - throw new ArgumentException("invalid hash"); - - verified=BCrypt.Net.BCrypt.Verify(plainText, hash); - - return verified; - - } - } -} diff --git a/backend/api/api/Services/ExperimentService.cs b/backend/api/api/Services/ExperimentService.cs index 7bdf9a6e..539e4c08 100644 --- a/backend/api/api/Services/ExperimentService.cs +++ b/backend/api/api/Services/ExperimentService.cs @@ -36,5 +36,15 @@ namespace api.Services return _experiment.Find(e=>e.uploaderId==id).ToList(); } + + public Experiment GetOneExperiment(string userId, string name) + { + return _experiment.Find(experiment => experiment.uploaderId == userId && experiment.name == name).FirstOrDefault(); + } + + public void Update(string userId, string id, Experiment experiment) + { + _experiment.ReplaceOne(experiment => experiment.uploaderId == userId && experiment._id == id, experiment); + } } } diff --git a/backend/api/api/Services/FillAnEmptyDb.cs b/backend/api/api/Services/FillAnEmptyDb.cs index d1208c9c..52f6e854 100644 --- a/backend/api/api/Services/FillAnEmptyDb.cs +++ b/backend/api/api/Services/FillAnEmptyDb.cs @@ -120,9 +120,8 @@ namespace api.Services experiment.uploaderId = "000000000000000000000000"; experiment.inputColumns = new string[] { "Embarked" }; experiment.outputColumn = "Survived"; - //experiment.randomOrder = true; - //experiment.randomTestSet = true; - //experiment.randomTestSetDistribution = 0.30000001192092896f; + experiment.dateCreated = DateTime.Now; + experiment.lastUpdated = DateTime.Now; experiment.nullValues = "delete_rows"; experiment.nullValuesReplacers = new NullValues[] { }; experiment.encodings = new[] @@ -234,9 +233,8 @@ namespace api.Services experiment.uploaderId = "000000000000000000000000"; experiment.inputColumns = new string[] { "Unnamed: 0", "carat", "cut", "color", "clarity", "depth", "table", "x", "y", "z" }; experiment.outputColumn = "price"; - //experiment.randomOrder = true; - //experiment.randomTestSet = true; - //experiment.randomTestSetDistribution = 0.30000001192092896f; + experiment.dateCreated = DateTime.Now; + experiment.lastUpdated = DateTime.Now; experiment.nullValues = "delete_rows"; experiment.nullValuesReplacers = new NullValues[] { }; experiment.encodings = new[] @@ -343,9 +341,8 @@ namespace api.Services experiment.uploaderId = "000000000000000000000000"; experiment.inputColumns = new string[] { "sepal_length", "sepal_width", "petal_length", "petal_width" }; experiment.outputColumn = "class"; - //experiment.randomOrder = true; - //experiment.randomTestSet = true; - //experiment.randomTestSetDistribution = 0.20000000298023224f; + experiment.dateCreated = DateTime.Now; + experiment.lastUpdated = DateTime.Now; experiment.nullValues = "delete_rows"; experiment.nullValuesReplacers = new NullValues[] { }; experiment.encodings = new[] diff --git a/backend/api/api/Services/JwtToken.cs b/backend/api/api/Services/JwtToken.cs new file mode 100644 index 00000000..06b3a666 --- /dev/null +++ b/backend/api/api/Services/JwtToken.cs @@ -0,0 +1,123 @@ +using System.IdentityModel.Tokens.Jwt; +using System.Security.Claims; +using System.Text; +using api.Models.Users; +using api.Services; +using Microsoft.IdentityModel.Tokens; + +namespace api.Models +{ + public class JwtToken : IJwtToken + { + private readonly IConfiguration _configuration; + private readonly IUserService _userService; + + public JwtToken(IConfiguration configuration, IUserService userService) + { + _configuration = configuration; + _userService = userService; + + } + + public string GenToken(AuthRequest user) + { + var tokenHandler = new JwtSecurityTokenHandler(); + var key = Encoding.ASCII.GetBytes(_configuration.GetSection("AppSettings:JwtToken").Value); + var fullUser = _userService.GetUserByUsername(user.UserName); + var tokenDescriptor = new SecurityTokenDescriptor + { + Subject = new ClaimsIdentity(new[] { new Claim("name", fullUser.Username), + new Claim("role", "User"), + new Claim("id",fullUser._id)}), + Expires = DateTime.UtcNow.AddMinutes(20), + SigningCredentials = new SigningCredentials(new SymmetricSecurityKey(key), SecurityAlgorithms.HmacSha256Signature) + }; + var token = tokenHandler.CreateToken(tokenDescriptor); + return tokenHandler.WriteToken(token); + + } + + public string RenewToken(string existingToken) + { + var userName = TokenToUsername(existingToken); + if (userName == null) + return null; + var authUser = new AuthRequest(); + authUser.UserName = userName; + + return GenToken(authUser); + + } + + public string TokenToUsername(string token) + { + if (token == null) + return null; + var tokenHandler = new JwtSecurityTokenHandler(); + var key = Encoding.ASCII.GetBytes(_configuration.GetSection("AppSettings:JwtToken").Value); + try + { + tokenHandler.ValidateToken(token, new TokenValidationParameters + { + ValidateIssuerSigningKey = true, + IssuerSigningKey = new SymmetricSecurityKey(key), + ValidateIssuer = false, + ValidateAudience = false, + }, out SecurityToken validatedToken); + + var jwtToken = (JwtSecurityToken)validatedToken; + return jwtToken.Claims.First(x => x.Type == "name").Value; + } + catch + { + return null; + } + + } + public string TokenToId(string token) + { + if (token == null) + return null; + var tokenHandler = new JwtSecurityTokenHandler(); + var key = Encoding.ASCII.GetBytes(_configuration.GetSection("AppSettings:JwtToken").Value); + try + { + tokenHandler.ValidateToken(token, new TokenValidationParameters + { + ValidateIssuerSigningKey = true, + IssuerSigningKey = new SymmetricSecurityKey(key), + ValidateIssuer = false, + ValidateAudience = false, + }, out SecurityToken validatedToken); + + var jwtToken = (JwtSecurityToken)validatedToken; + return jwtToken.Claims.First(x => x.Type == "id").Value; + } + catch + { + return null; + } + + } + + public string GenGuestToken() + { + var tokenHandler = new JwtSecurityTokenHandler(); + var key = Encoding.ASCII.GetBytes(_configuration.GetSection("AppSettings:JwtToken").Value); + var tokenDescriptor = new SecurityTokenDescriptor + { + Subject = new ClaimsIdentity(new[] { new Claim("name",""), + new Claim("role", "Guest"), + new Claim("id","")}), + Expires = DateTime.UtcNow.AddMinutes(20), + SigningCredentials = new SigningCredentials(new SymmetricSecurityKey(key), SecurityAlgorithms.HmacSha256Signature) + }; + var token = tokenHandler.CreateToken(tokenDescriptor); + return tokenHandler.WriteToken(token); + + } + + + + } +} diff --git a/backend/api/api/Services/PasswordCrypt.cs b/backend/api/api/Services/PasswordCrypt.cs new file mode 100644 index 00000000..016fde51 --- /dev/null +++ b/backend/api/api/Services/PasswordCrypt.cs @@ -0,0 +1,27 @@ +namespace api.Models +{ + public class PasswordCrypt + { + private static int difficulty = 10; + + public static String hashPassword(String password) + { + String salt = BCrypt.Net.BCrypt.GenerateSalt(difficulty); + String passwordHash = BCrypt.Net.BCrypt.HashPassword(password, salt); + + return passwordHash; + } + public static Boolean checkPassword(String plainText,String hash) + { + Boolean verified = false; + + if (hash == null || !hash.StartsWith("$2a$")) + throw new ArgumentException("invalid hash"); + + verified=BCrypt.Net.BCrypt.Verify(plainText, hash); + + return verified; + + } + } +} diff --git a/frontend/src/app/_services/experiments.service.ts b/frontend/src/app/_services/experiments.service.ts index ce112498..29569fca 100644 --- a/frontend/src/app/_services/experiments.service.ts +++ b/frontend/src/app/_services/experiments.service.ts @@ -20,7 +20,7 @@ export class ExperimentsService { return this.http.get(`${Configuration.settings.apiURL}/experiment/getmyexperiments`, { headers: this.authService.authHeader() }); } - /*updateExperiment(){ - - }*/ + updateExperiment(experiment: Experiment): Observable { + return this.http.put(`${Configuration.settings.apiURL}/experiment/` + experiment._id, experiment, { headers: this.authService.authHeader() }); + } } -- cgit v1.2.3