From ea782e76a74a5db2f2590a17de452769aada31c5 Mon Sep 17 00:00:00 2001 From: Alexander Date: Fri, 1 Dec 2023 14:36:22 +0100 Subject: [PATCH] feat(backend): added projectID check for getUXTest endpoint (add missing file) --- backend/pkg/uxtesting/uxtesting.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/pkg/uxtesting/uxtesting.go b/backend/pkg/uxtesting/uxtesting.go index 5c0b1fc9a..edd84ed89 100644 --- a/backend/pkg/uxtesting/uxtesting.go +++ b/backend/pkg/uxtesting/uxtesting.go @@ -21,6 +21,7 @@ func New(db pool.Pool) UXTesting { } type UXTestInfo struct { + ProjectID uint32 `json:"-"` Title string `json:"title"` Description string `json:"description"` StartingPath string `json:"startingPath"` @@ -37,6 +38,7 @@ func (u *uxTestingImpl) GetInfo(testID string) (*UXTestInfo, error) { var description, startingPath, guidelines, conclusion *string err := u.db.QueryRow(` SELECT + ut_tests.project_id, ut_tests.title, ut_tests.description, ut_tests.starting_path, @@ -60,7 +62,7 @@ func (u *uxTestingImpl) GetInfo(testID string) (*UXTestInfo, error) { WHERE ut_tests.test_id = $1 GROUP BY ut_tests.test_id; - `, testID).Scan(&info.Title, &description, &startingPath, &info.Status, &info.ReqMic, &info.ReqCamera, + `, testID).Scan(&info.ProjectID, &info.Title, &description, &startingPath, &info.Status, &info.ReqMic, &info.ReqCamera, &guidelines, &conclusion, &info.Tasks) if err != nil { return nil, err