diff options
author | DESKTOP-S0O2C44\ROG <ivan996sk@gmail.com> | 2022-03-09 19:59:05 +0100 |
---|---|---|
committer | DESKTOP-S0O2C44\ROG <ivan996sk@gmail.com> | 2022-03-09 19:59:05 +0100 |
commit | 191d14be7be275e1f5de58c2cbf83fec9d27cf52 (patch) | |
tree | 017c054e0cba49870bf6c3d01e8dfbce37a95f64 /backend | |
parent | cbdc8218e3a6c6641caebefaab1e4905e44590fb (diff) |
Ipravljen update korisnika #24
Diffstat (limited to 'backend')
-rw-r--r-- | backend/api/api/Controllers/UserController.cs | 7 | ||||
-rw-r--r-- | backend/api/api/appsettings.json | 4 |
2 files changed, 7 insertions, 4 deletions
diff --git a/backend/api/api/Controllers/UserController.cs b/backend/api/api/Controllers/UserController.cs index b1544477..a106880e 100644 --- a/backend/api/api/Controllers/UserController.cs +++ b/backend/api/api/Controllers/UserController.cs @@ -56,10 +56,11 @@ namespace api.Controllers { var existingUser = userService.Get(id); + //ne mora da se proverava if(existingUser == null) return NotFound($"User with Id = {id} not found"); - userService.Update(id, existingUser); + userService.Update(id, user); return NoContent(); } @@ -79,9 +80,7 @@ namespace api.Controllers } /* { - "userId": { - "$oid": "62276146c4a20eabc664abc3" - }, + "_id": "", "username" : "ivan996sk", "email" : "ivan996sk@gmail.com", "password" : "proba", diff --git a/backend/api/api/appsettings.json b/backend/api/api/appsettings.json index d2c95254..257c2f45 100644 --- a/backend/api/api/appsettings.json +++ b/backend/api/api/appsettings.json @@ -13,5 +13,9 @@ "ConnectionString": "mongodb://127.0.0.1:27017/", "DatabaseName": "si_project", "CollectionName": "User" + /* "ConnectionString": "mongodb+srv://SIDatabase:SIDatabase@sidatabase.twtfm.mongodb.net/myFirstDatabase?retryWrites=true&w=majority", + "DatabaseName": "si_db", + "CollectionName": "users" + */ } } |