From 079a57696e71ed548348b91b96f99af1bf30498a Mon Sep 17 00:00:00 2001 From: Dharneeshcr7 <76260467+Dharneeshcr7@users.noreply.github.com> Date: Fri, 19 Jan 2024 19:42:25 +0530 Subject: [PATCH 1/3] task1_dharneesh --- CommBank-Server/Models/Goal.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CommBank-Server/Models/Goal.cs b/CommBank-Server/Models/Goal.cs index 77ff1ad..20b9b5d 100644 --- a/CommBank-Server/Models/Goal.cs +++ b/CommBank-Server/Models/Goal.cs @@ -27,4 +27,6 @@ public class Goal [BsonRepresentation(BsonType.ObjectId)] public string? UserId { get; set; } + + public string? Icon { get; set; } } \ No newline at end of file From eea9d24091836533cdb160eb79591332cf1c3c39 Mon Sep 17 00:00:00 2001 From: Dharneeshcr7 <76260467+Dharneeshcr7@users.noreply.github.com> Date: Fri, 19 Jan 2024 19:50:14 +0530 Subject: [PATCH 2/3] vjh --- CommBank-Server/CommBank.csproj | 2 +- CommBank-Server/Controllers/GoalController.cs | 2 +- CommBank-Server/Program.cs | 4 ++-- CommBank-Server/Secrets.json | 2 +- CommBank-Server/api-task1 | 12 ++++++++++++ 5 files changed, 17 insertions(+), 5 deletions(-) create mode 100644 CommBank-Server/api-task1 diff --git a/CommBank-Server/CommBank.csproj b/CommBank-Server/CommBank.csproj index 983cc88..1270ab7 100644 --- a/CommBank-Server/CommBank.csproj +++ b/CommBank-Server/CommBank.csproj @@ -13,7 +13,7 @@ - + diff --git a/CommBank-Server/Controllers/GoalController.cs b/CommBank-Server/Controllers/GoalController.cs index 98271a5..c1f1987 100644 --- a/CommBank-Server/Controllers/GoalController.cs +++ b/CommBank-Server/Controllers/GoalController.cs @@ -79,7 +79,7 @@ public async Task Update(string id, Goal updatedGoal) } updatedGoal.Id = goal.Id; - + Console.WriteLine(goal.Balance); await _goalsService.UpdateAsync(id, updatedGoal); return NoContent(); diff --git a/CommBank-Server/Program.cs b/CommBank-Server/Program.cs index a88e560..047e300 100644 --- a/CommBank-Server/Program.cs +++ b/CommBank-Server/Program.cs @@ -12,8 +12,8 @@ builder.Configuration.SetBasePath(Directory.GetCurrentDirectory()).AddJsonFile("Secrets.json"); var mongoClient = new MongoClient(builder.Configuration.GetConnectionString("CommBank")); -var mongoDatabase = mongoClient.GetDatabase("CommBank"); - +var mongoDatabase = mongoClient.GetDatabase("commonwealth_dbco"); +Console.WriteLine(mongoClient); IAccountsService accountsService = new AccountsService(mongoDatabase); IAuthService authService = new AuthService(mongoDatabase); IGoalsService goalsService = new GoalsService(mongoDatabase); diff --git a/CommBank-Server/Secrets.json b/CommBank-Server/Secrets.json index 0e5bf94..e432297 100644 --- a/CommBank-Server/Secrets.json +++ b/CommBank-Server/Secrets.json @@ -1,5 +1,5 @@ { "ConnectionStrings": { - "CommBank": "{CONNECTION_STRING}" + "CommBank": "mongodb+srv://dharneeshcr7:dharnalm10@cluster0.vgeognk.mongodb.net/?retryWrites=true&w=majority" } } \ No newline at end of file diff --git a/CommBank-Server/api-task1 b/CommBank-Server/api-task1 new file mode 100644 index 0000000..d039704 --- /dev/null +++ b/CommBank-Server/api-task1 @@ -0,0 +1,12 @@ +{ + "id": "62a3f587102e921da1253d32", + "name": "House Down Payment", + "targetAmount": 100000, + "targetDate": "2025-01-08T05:00:00Z", + "balance": 73501.82, + "created": "2022-06-11T01:53:10.857Z", + "transactionIds": null, + "tagIds": null, + "userId": "62a29c15f4605c4c9fa7f306", + "icon": "🤺" +} \ No newline at end of file From f514e0fd19b5d0acc4ed9b3c7ddd6f46bdaa91b4 Mon Sep 17 00:00:00 2001 From: Dharneeshcr7 <76260467+Dharneeshcr7@users.noreply.github.com> Date: Fri, 19 Jan 2024 19:54:00 +0530 Subject: [PATCH 3/3] Revert "vjh" This reverts commit eea9d24091836533cdb160eb79591332cf1c3c39. --- CommBank-Server/CommBank.csproj | 2 +- CommBank-Server/Controllers/GoalController.cs | 2 +- CommBank-Server/Program.cs | 4 ++-- CommBank-Server/Secrets.json | 2 +- CommBank-Server/api-task1 | 12 ------------ 5 files changed, 5 insertions(+), 17 deletions(-) delete mode 100644 CommBank-Server/api-task1 diff --git a/CommBank-Server/CommBank.csproj b/CommBank-Server/CommBank.csproj index 1270ab7..983cc88 100644 --- a/CommBank-Server/CommBank.csproj +++ b/CommBank-Server/CommBank.csproj @@ -13,7 +13,7 @@ - + diff --git a/CommBank-Server/Controllers/GoalController.cs b/CommBank-Server/Controllers/GoalController.cs index c1f1987..98271a5 100644 --- a/CommBank-Server/Controllers/GoalController.cs +++ b/CommBank-Server/Controllers/GoalController.cs @@ -79,7 +79,7 @@ public async Task Update(string id, Goal updatedGoal) } updatedGoal.Id = goal.Id; - Console.WriteLine(goal.Balance); + await _goalsService.UpdateAsync(id, updatedGoal); return NoContent(); diff --git a/CommBank-Server/Program.cs b/CommBank-Server/Program.cs index 047e300..a88e560 100644 --- a/CommBank-Server/Program.cs +++ b/CommBank-Server/Program.cs @@ -12,8 +12,8 @@ builder.Configuration.SetBasePath(Directory.GetCurrentDirectory()).AddJsonFile("Secrets.json"); var mongoClient = new MongoClient(builder.Configuration.GetConnectionString("CommBank")); -var mongoDatabase = mongoClient.GetDatabase("commonwealth_dbco"); -Console.WriteLine(mongoClient); +var mongoDatabase = mongoClient.GetDatabase("CommBank"); + IAccountsService accountsService = new AccountsService(mongoDatabase); IAuthService authService = new AuthService(mongoDatabase); IGoalsService goalsService = new GoalsService(mongoDatabase); diff --git a/CommBank-Server/Secrets.json b/CommBank-Server/Secrets.json index e432297..0e5bf94 100644 --- a/CommBank-Server/Secrets.json +++ b/CommBank-Server/Secrets.json @@ -1,5 +1,5 @@ { "ConnectionStrings": { - "CommBank": "mongodb+srv://dharneeshcr7:dharnalm10@cluster0.vgeognk.mongodb.net/?retryWrites=true&w=majority" + "CommBank": "{CONNECTION_STRING}" } } \ No newline at end of file diff --git a/CommBank-Server/api-task1 b/CommBank-Server/api-task1 deleted file mode 100644 index d039704..0000000 --- a/CommBank-Server/api-task1 +++ /dev/null @@ -1,12 +0,0 @@ -{ - "id": "62a3f587102e921da1253d32", - "name": "House Down Payment", - "targetAmount": 100000, - "targetDate": "2025-01-08T05:00:00Z", - "balance": 73501.82, - "created": "2022-06-11T01:53:10.857Z", - "transactionIds": null, - "tagIds": null, - "userId": "62a29c15f4605c4c9fa7f306", - "icon": "🤺" -} \ No newline at end of file