aboutsummaryrefslogtreecommitdiff
path: root/API/Service
diff options
context:
space:
mode:
authorSyndamia <kamen.d.mladenov@protonmail.com>2020-12-10 12:11:48 +0200
committerSyndamia <kamen.d.mladenov@protonmail.com>2020-12-10 12:11:48 +0200
commit68edd82480a4107ec32adaeefa479c6364b0c841 (patch)
tree1564ed90b5688af9be08ef25d729cfe134331931 /API/Service
parent2b3e8644f4e581874d54ac3950603edafba72bd6 (diff)
downloadDevHive-68edd82480a4107ec32adaeefa479c6364b0c841.tar
DevHive-68edd82480a4107ec32adaeefa479c6364b0c841.tar.gz
DevHive-68edd82480a4107ec32adaeefa479c6364b0c841.zip
Implemented User put (update) query (that works with test values, needs mapper)
Diffstat (limited to 'API/Service')
-rw-r--r--API/Service/UserService.cs16
1 files changed, 16 insertions, 0 deletions
diff --git a/API/Service/UserService.cs b/API/Service/UserService.cs
index b9fe91d..e678b17 100644
--- a/API/Service/UserService.cs
+++ b/API/Service/UserService.cs
@@ -36,5 +36,21 @@ namespace API.Service
User user = await this._dbRepository.FindByIdAsync(id);
return JsonConvert.SerializeObject(user);
}
+
+ [HttpPut]
+ public async Task<HttpStatusCode> UpdateUser(int id, UserDTO userDTO)
+ {
+ // TODO: add mapper (UserDTO to User)
+ User user = new User{
+ Id = id,
+ FirstName = "Misho",
+ LastName = "Mishov",
+ UserName = "cheese"
+ };
+ await this._dbRepository.EditAsync(id, user);
+
+ return HttpStatusCode.OK;
+ }
+
}
}