Skip to content

Commit 9d228ec

Browse files
committed
id fix
1 parent 65099f2 commit 9d228ec

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

.gitignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Binaries for programs and plugins
2+
*.exe
3+
*.exe~
4+
*.dll
5+
*.so
6+
*.dylib
7+
8+
# Test binary, built with `go test -c`
9+
*.test
10+
11+
# Output of the go coverage tool, specifically when used with LiteIDE
12+
*.out
13+
14+
# Dependency directories (remove the comment below to include it)
15+
vendor/

server/api/api_notifications_api_service.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,11 @@ func (s *NotificationsApiService) AddNotification(ctx context.Context, request N
6565
defer db.Close()
6666

6767
var notificationId sql.NullInt32
68-
err = db.QueryRow("SELECT id FROM public.new_notification($1, $2);", request.NotificationType, request.NotificationText).Scan(&notificationId)
68+
err = db.QueryRow("SELECT public.new_notification($1, $2);", request.NotificationType, request.NotificationText).Scan(&notificationId)
69+
70+
if err != nil {
71+
return Response(http.StatusInternalServerError, nil), err
72+
}
6973

7074
return Response(http.StatusCreated, Id{Id: notificationId.Int32}), nil
7175
}

0 commit comments

Comments
 (0)