Skip to content

Commit

Permalink
hot fix
Browse files Browse the repository at this point in the history
  • Loading branch information
PhucNghi176 committed Oct 17, 2024
1 parent 6ed5a1a commit 8ee02b0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
13 changes: 7 additions & 6 deletions MBS-COMMAND.API/appsettings.Development.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"ConnectionStrings": {
"ConnectionStrings": "Server=103.162.14.116;Database=PRN_SUPER;Uid=sa;Pwd=MyStrongPassword123@;Trust Server Certificate=True;",
"ConnectionStrings": "Server=(local);Database=PRN_SUPER;Uid=sa;Pwd=12345;Trust Server Certificate=True;",
"Redis": "103.162.14.116:6379,password=MyStrongPassword123@,abortConnect=false"
},
"JwtOption": {
Expand All @@ -10,11 +10,11 @@
"ExpireMin": 5
},
"MasstransitConfiguration": {
"Host": "103.162.14.116",
"VHost": "myHost",
"Host": "local",
"VHost": "phucnghi",
"Port": 5672,
"UserName": "sa",
"Password": "MyStrongPassword123@"
"UserName": "guest",
"Password": "guest"
},
"MessageBusOptions": {
"retryLimit": 3,
Expand Down Expand Up @@ -69,5 +69,6 @@
"WithThreadId"
]
},
"AllowedHosts": "*"
"AllowedHosts": "*",
"Domain" : "localhost:3000"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,26 @@

namespace MBS_COMMAND.Application.UserCases.Commands.Groups;

public sealed class CreateGroupCommandHandler(IRepositoryBase<Group, Guid> repositoryBase, IRepositoryBase<User, Guid> userRepository, ICurrentUserService currentUserService) : ICommandHandler<Command.CreateGroupCommand>
public sealed class CreateGroupCommandHandler(
IRepositoryBase<Group, Guid> repositoryBase,
IRepositoryBase<User, Guid> userRepository,
ICurrentUserService currentUserService) : ICommandHandler<Command.CreateGroupCommand>
{
public async Task<Result> Handle(Command.CreateGroupCommand request, CancellationToken cancellationToken)
{
var M = await userRepository.FindSingleAsync(x => x.Id == request.MentorId, cancellationToken);
if (M == null)
return Result.Failure(new Error("404", "Mentor Not Found"));
/* var T = Guid.TryParse(currentUserService.UserId, out Guid L);
var T = Guid.TryParse(currentUserService.UserId, out var L);
if (!T)
return Result.Failure(new Error("404", "User Not Authorized"));*/
return Result.Failure(new Error("404", "User Not Authorized"));
var G = new Group
{
Name = request.Name,
MentorId = request.MentorId,
Stack = request.Stacks,
// LeaderId = L

// LeaderId = L
};
G.Members!.Add(new Group_Student_Mapping { StudentId = M.Id, GroupId = G.Id });
G.Members!.Add(new Group_Student_Mapping { StudentId = L, GroupId = G.Id });
repositoryBase.Add(G);

return Result.Success();
}
}
}

0 comments on commit 8ee02b0

Please sign in to comment.