This commit is contained in:
2025-05-19 03:56:20 +07:00
parent e409a69a54
commit 4b44bad1c0
4 changed files with 44 additions and 4 deletions
+6 -2
View File
@@ -30,7 +30,11 @@ func NewServices(
}
func (s *Services) GiveApplications(ctx context.Context, req *proto.GiveApplicationsReq) (*proto.GiveApplicationsRsp, error) {
panic("unimplemented")
applications := mapProtoApplicationsToApplications(req.Applications)
if err := s.repository.GiveApplications(ctx, req.TeamId, applications); err != nil {
return nil, status.Errorf(codes.Internal, err.Error())
}
return &proto.GiveApplicationsRsp{}, nil
}
func (s *Services) GameStop(ctx context.Context, req *proto.GameStopReq) (*proto.GameStopRsp, error) {
@@ -57,7 +61,7 @@ func (s *Services) AddAction(ctx context.Context, req *proto.AddActionReq) (*pro
Applications: mapStoryApplicationsToApplications(place.Applications),
},
}
if err := s.repository.AddActions(ctx, actions); err != nil {
if err := s.repository.AddActions(ctx, team.ID, actions); err != nil {
return nil, status.Errorf(codes.Internal, err.Error())
}
if err := s.repository.AddApplications(ctx, actions); err != nil {