File tree Expand file tree Collapse file tree 1 file changed +1
-18
lines changed
internal/services/projects Expand file tree Collapse file tree 1 file changed +1
-18
lines changed Original file line number Diff line number Diff line change 1
1
package services
2
2
3
3
import (
4
- "database/sql"
5
- "errors"
6
-
7
4
"github.com/CodeChefVIT/devsoc-backend-24/internal/database"
8
5
"github.com/CodeChefVIT/devsoc-backend-24/internal/models"
9
6
"github.com/google/uuid"
@@ -15,13 +12,6 @@ func GetProject(teamid uuid.UUID) (models.Project, error) {
15
12
err := database .DB .QueryRow (query , teamid ).Scan (& proj .Name ,
16
13
& proj .Description , & proj .GithubLink , & proj .FigmaLink ,
17
14
& proj .Track , & proj .Others )
18
- if err != nil {
19
- if errors .Is (err , sql .ErrNoRows ) {
20
- return proj , nil
21
- } else {
22
- return proj , err
23
- }
24
- }
25
15
return proj , err
26
16
}
27
17
@@ -31,14 +21,7 @@ func GetProjectByID(projectID uuid.UUID) (models.Project, error) {
31
21
err := database .DB .QueryRow (query , projectID ).Scan (& proj .Name ,
32
22
& proj .Description , & proj .GithubLink , & proj .FigmaLink ,
33
23
& proj .Track , & proj .Others )
34
- if err != nil {
35
- if err == sql .ErrNoRows {
36
- return proj , nil
37
- } else {
38
- return proj , err
39
- }
40
- }
41
- return proj , nil
24
+ return proj , err
42
25
}
43
26
44
27
func GetAllProjects () ([]models.AdminGetProject , error ) {
You can’t perform that action at this time.
0 commit comments