generated from VLADIMIR/template
up
This commit is contained in:
@@ -90,9 +90,9 @@ func (r *Repository) GetActions(ctx context.Context, teamId int64) ([]*models.Ac
|
||||
return actions, nil
|
||||
}
|
||||
|
||||
func (r *Repository) AddActions(ctx context.Context, actions []*models.Action) error {
|
||||
func (r *Repository) AddActions(ctx context.Context, teamId int64, actions []*models.Action) error {
|
||||
for _, action := range actions {
|
||||
_, err := r.db.Exec("insert into actions (place, teamId) values ($1, $2)", action.Place, action.TeamID)
|
||||
_, err := r.db.Exec("insert into actions (place, teamId) values ($1, $2)", action.Place, teamId)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -152,3 +152,13 @@ func (r *Repository) GetApplications(ctx context.Context, teamId int64, state st
|
||||
}
|
||||
return applications, nil
|
||||
}
|
||||
|
||||
func (r *Repository) GiveApplications(ctx context.Context, teamId int64, applications []*models.Application) error {
|
||||
for _, application := range applications {
|
||||
_, err := r.db.Exec("update applications set state = \"gave\" where teamId = $1 and id = $2", teamId, application.ID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user