Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CommBank-Server/CommBank.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>CommBank_Server</RootNamespace>
Expand Down
5 changes: 3 additions & 2 deletions CommBank-Server/Models/Goal.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using MongoDB.Bson;
using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;

namespace CommBank.Models;
Expand Down Expand Up @@ -27,4 +27,5 @@ public class Goal

[BsonRepresentation(BsonType.ObjectId)]
public string? UserId { get; set; }
}
public string? Icon { get; set; }
}
4 changes: 2 additions & 2 deletions CommBank-Server/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using CommBank.Models;
using CommBank.Models;
using CommBank.Services;
using MongoDB.Driver;

Expand All @@ -12,7 +12,7 @@
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("commbank");

IAccountsService accountsService = new AccountsService(mongoDatabase);
IAuthService authService = new AuthService(mongoDatabase);
Expand Down
6 changes: 3 additions & 3 deletions CommBank-Server/Secrets.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
{
"ConnectionStrings": {
"CommBank": "{CONNECTION_STRING}"
"CommBank": "mongodb+srv://jaikiranjp_db_user:8hU5jpA1Q9KsGop5@commbank.8tvgsl4.mongodb.net/?retryWrites=true&w=majority&appName=commbank"
}
}
}
6 changes: 3 additions & 3 deletions CommBank-Server/Services/GoalService.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using CommBank.Models;
using CommBank.Models;
using MongoDB.Driver;

namespace CommBank.Services;
Expand All @@ -9,7 +9,7 @@ public class GoalsService : IGoalsService

public GoalsService(IMongoDatabase mongoDatabase)
{
_goalsCollection = mongoDatabase.GetCollection<Goal>("Goals");
_goalsCollection = mongoDatabase.GetCollection<Goal>("goals");
}

public async Task<List<Goal>> GetAsync() =>
Expand All @@ -29,4 +29,4 @@ public async Task UpdateAsync(string id, Goal updatedGoal) =>

public async Task RemoveAsync(string id) =>
await _goalsCollection.DeleteOneAsync(x => x.Id == id);
}
}
10 changes: 7 additions & 3 deletions CommBank-Server/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*"
}

"AllowedHosts": "*",
"GoalDatabaseSettings": {
"ConnectionString": "mongodb+srv://jaikiranjp_db_user:8hU5jpA1Q9KsGop5@commbank.8tvgsl4.mongodb.net/?retryWrites=true&w=majority&appName=commbank",
"DatabaseName": "commbank",
"GoalsCollectionName": "goals"
}
}
2 changes: 1 addition & 1 deletion CommBank.Tests/CommBank.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

Expand Down
4 changes: 2 additions & 2 deletions CommBank.Tests/GoalControllerTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using CommBank.Controllers;
using CommBank.Controllers;
using CommBank.Services;
using CommBank.Models;
using CommBank.Tests.Fake;
Expand Down Expand Up @@ -71,4 +71,4 @@ public async void GetForUser()

// Assert
}
}
}