add load applications

This commit is contained in:
2026-08-30 21:17:32 +07:00
parent 3b15fb3a2b
commit c0b5ceb65f
28 changed files with 1536 additions and 139 deletions
+6 -2
View File
@@ -27,15 +27,17 @@ func (r *ApplicationsRepo) AddApplication(
teamId int,
name string,
image string,
fileType string,
) (int, error) {
id := 0
err := r.pool.QueryRow(
ctx,
`INSERT INTO applications (name, image, team_id)
VALUES ($1, $2, $3)
`INSERT INTO applications (name, image, file_type, team_id)
VALUES ($1, $2, $3, $4)
RETURNING id`,
name,
image,
fileType,
teamId,
).Scan(&id)
@@ -55,6 +57,7 @@ func (r *ApplicationsRepo) GetApplicationsByTeamIDsAndState(
`SELECT
name,
image,
file_type,
team_id
FROM applications
WHERE team_id = ANY($1) and status = $2`,
@@ -72,6 +75,7 @@ func (r *ApplicationsRepo) GetApplicationsByTeamIDsAndState(
err := rows.Scan(
&application.Name,
&application.Image,
&application.FileType,
&application.TeamId,
)
if err != nil {