generated from VLADIMIR/template
up
This commit is contained in:
@@ -29,7 +29,7 @@ func NewApplicationsRepo(pool *pgxpool.Pool) *ApplicationsRepo {
|
||||
// AddApplication stores an application for a team.
|
||||
func (r *ApplicationsRepo) AddApplication(
|
||||
ctx context.Context,
|
||||
teamID int,
|
||||
teamID string,
|
||||
name string,
|
||||
image string,
|
||||
fileType string,
|
||||
@@ -55,9 +55,9 @@ func (r *ApplicationsRepo) AddApplication(
|
||||
// GetApplicationsByTeamIDsAndState returns applications matching team IDs and state.
|
||||
func (r *ApplicationsRepo) GetApplicationsByTeamIDsAndState(
|
||||
ctx context.Context,
|
||||
teamIDs []int,
|
||||
teamIDs []string,
|
||||
state string,
|
||||
) (map[int][]*repos.Application, error) {
|
||||
) (map[string][]*repos.Application, error) {
|
||||
rows, err := r.pool.Query(
|
||||
ctx,
|
||||
`SELECT
|
||||
@@ -75,7 +75,7 @@ func (r *ApplicationsRepo) GetApplicationsByTeamIDsAndState(
|
||||
}
|
||||
defer rows.Close()
|
||||
|
||||
res := make(map[int][]*repos.Application, len(teamIDs))
|
||||
res := make(map[string][]*repos.Application, len(teamIDs))
|
||||
for rows.Next() {
|
||||
application := &repos.Application{}
|
||||
err := rows.Scan(
|
||||
@@ -99,7 +99,7 @@ func (r *ApplicationsRepo) GetApplicationsByTeamIDsAndState(
|
||||
// UpdateApplicationStatus changes an application's status.
|
||||
func (r *ApplicationsRepo) UpdateApplicationStatus(
|
||||
ctx context.Context,
|
||||
teamID int,
|
||||
teamID string,
|
||||
name string,
|
||||
status string,
|
||||
) error {
|
||||
@@ -123,7 +123,7 @@ func (r *ApplicationsRepo) UpdateApplicationStatus(
|
||||
}
|
||||
|
||||
// DeleteApplicationByTeamIDAndName removes an application by team and name.
|
||||
func (r *ApplicationsRepo) DeleteApplicationByTeamIDAndName(ctx context.Context, teamID int, name string) error {
|
||||
func (r *ApplicationsRepo) DeleteApplicationByTeamIDAndName(ctx context.Context, teamID string, name string) error {
|
||||
tag, err := r.pool.Exec(
|
||||
ctx,
|
||||
`DELETE FROM applications
|
||||
|
||||
Reference in New Issue
Block a user