update and fix

This commit is contained in:
2025-05-29 02:37:10 +07:00
parent 63d1e85c7f
commit 49999e9e70
9 changed files with 156 additions and 39 deletions
+3 -9
View File
@@ -53,10 +53,7 @@ func (s *Services) AddAction(ctx context.Context, req *proto.AddActionReq) (*pro
if err != nil {
return nil, err
}
place, err := s.storyService.GetPlace(req.Place)
if err != nil {
return nil, err
}
place := s.storyService.GetPlace(req.Place)
actions := []*models.Action{
{
Place: place.Code,
@@ -87,10 +84,7 @@ func (s *Services) GetTeam(ctx context.Context, req *proto.GetTeamReq) (*proto.G
res := make([]*proto.Action, 0, len(actions))
for _, action := range actions {
newAction := mapActionToProtoAction(action)
place, err := s.storyService.GetPlace(action.Place)
if err != nil {
return nil, err
}
place := s.storyService.GetPlace(action.Place)
newAction.Text = place.Text
newAction.Name = place.Name
newAction.Applications = make([]*proto.Application, 0, len(place.Applications))
@@ -125,7 +119,7 @@ func (s *Services) GetTeams(ctx context.Context, _ *proto.GetTeamsReq) (*proto.G
if err != nil {
return nil, err
}
newTeam.SpendTime = int64(20 * len(actions))
newTeam.SpendTime = int64(len(actions))
applications, err := s.repository.GetApplications(ctx, team.ID, "NEW")
if err != nil {
return nil, err