Skip to content

Commit

Permalink
Merge pull request #56 from Killerrekt/master
Browse files Browse the repository at this point in the history
dumb mistakes were made
  • Loading branch information
aditansh authored Mar 17, 2024
2 parents b94f374 + 2fd4f5c commit c5a1d0d
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions internal/services/projects/get_projects.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
package services

import (
"database/sql"
"errors"

"github.com/CodeChefVIT/devsoc-backend-24/internal/database"
"github.com/CodeChefVIT/devsoc-backend-24/internal/models"
"github.com/google/uuid"
Expand All @@ -15,13 +12,6 @@ func GetProject(teamid uuid.UUID) (models.Project, error) {
err := database.DB.QueryRow(query, teamid).Scan(&proj.Name,
&proj.Description, &proj.GithubLink, &proj.FigmaLink,
&proj.Track, &proj.Others)
if err != nil {
if errors.Is(err, sql.ErrNoRows) {
return proj, nil
} else {
return proj, err
}
}
return proj, err
}

Expand All @@ -31,14 +21,7 @@ func GetProjectByID(projectID uuid.UUID) (models.Project, error) {
err := database.DB.QueryRow(query, projectID).Scan(&proj.Name,
&proj.Description, &proj.GithubLink, &proj.FigmaLink,
&proj.Track, &proj.Others)
if err != nil {
if err == sql.ErrNoRows {
return proj, nil
} else {
return proj, err
}
}
return proj, nil
return proj, err
}

func GetAllProjects() ([]models.AdminGetProject, error) {
Expand Down

0 comments on commit c5a1d0d

Please sign in to comment.