fix names

This commit is contained in:
2026-10-01 13:13:03 +07:00
parent 76af14cb96
commit f462bc6a03
24 changed files with 213 additions and 213 deletions
+11 -11
View File
@@ -24,7 +24,7 @@ func NewApplicationsRepo(pool *pgxpool.Pool) *ApplicationsRepo {
func (r *ApplicationsRepo) AddApplication(
ctx context.Context,
teamId int,
teamID int,
name string,
image string,
fileType string,
@@ -38,7 +38,7 @@ func (r *ApplicationsRepo) AddApplication(
name,
image,
fileType,
teamId,
teamID,
).Scan(&id)
if err != nil {
@@ -49,7 +49,7 @@ func (r *ApplicationsRepo) AddApplication(
func (r *ApplicationsRepo) GetApplicationsByTeamIDsAndState(
ctx context.Context,
teamIds []int,
teamIDs []int,
state string,
) (map[int][]*repos.Application, error) {
rows, err := r.pool.Query(
@@ -61,7 +61,7 @@ func (r *ApplicationsRepo) GetApplicationsByTeamIDsAndState(
team_id
FROM applications
WHERE team_id = ANY($1) and status = $2`,
teamIds,
teamIDs,
state,
)
if err != nil {
@@ -69,19 +69,19 @@ func (r *ApplicationsRepo) GetApplicationsByTeamIDsAndState(
}
defer rows.Close()
res := make(map[int][]*repos.Application, len(teamIds))
res := make(map[int][]*repos.Application, len(teamIDs))
for rows.Next() {
application := &repos.Application{}
err := rows.Scan(
&application.Name,
&application.Image,
&application.FileType,
&application.TeamId,
&application.TeamID,
)
if err != nil {
return nil, err
}
res[application.TeamId] = append(res[application.TeamId], application)
res[application.TeamID] = append(res[application.TeamID], application)
}
if err := rows.Err(); err != nil {
return nil, err
@@ -92,7 +92,7 @@ func (r *ApplicationsRepo) GetApplicationsByTeamIDsAndState(
func (r *ApplicationsRepo) UpdateApplicationStatus(
ctx context.Context,
teamId int,
teamID int,
name string,
status string,
) error {
@@ -103,7 +103,7 @@ func (r *ApplicationsRepo) UpdateApplicationStatus(
status = $1
WHERE team_id = $2 and name = $3`,
status,
teamId,
teamID,
name,
)
if err != nil {
@@ -115,7 +115,7 @@ func (r *ApplicationsRepo) UpdateApplicationStatus(
return nil
}
func (r *ApplicationsRepo) DeleteApplicationByTeamIdAndName(ctx context.Context, teamId int, name string) error {
func (r *ApplicationsRepo) DeleteApplicationByTeamIDAndName(ctx context.Context, teamID int, name string) error {
tag, err := r.pool.Exec(
ctx,
`DELETE FROM applications
@@ -126,7 +126,7 @@ func (r *ApplicationsRepo) DeleteApplicationByTeamIdAndName(ctx context.Context,
ORDER BY created_at DESC
LIMIT 1
)`,
teamId,
teamID,
name,
)
if err != nil {