Skip to content

Commit

Permalink
[ID-78] User survey responses not accessible (#83)
Browse files Browse the repository at this point in the history
* set the Changelog.md

* fix the API

* remove from update survey

* add default type value

* fix gofmt

---------

Co-authored-by: Stefan Vitanov <[email protected]>
Co-authored-by: Stephen Hurwit <[email protected]>
  • Loading branch information
3 people authored Nov 26, 2024
1 parent c301edc commit 9ece47c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Fixed
- User survey responses not accessible [#78](https://github.com/rokwire/surveys-building-block/issues/78)

## [1.11.0] - 2024-10-07
### Added
- Consolidate the information, and make it accessible with a single API call [#79](https://github.com/rokwire/surveys-building-block/issues/79)
Expand Down
8 changes: 6 additions & 2 deletions driver/web/apis_admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,9 @@ func (h AdminAPIsHandler) createSurvey(l *logs.Log, r *http.Request, claims *tok
items.CreatorID = claims.Subject
items.OrgID = claims.OrgID
items.AppID = claims.AppID
items.Type = "user"
if items.Type == "" {
items.Type = "user"
}

item := surveyRequestToSurvey(items)

Expand Down Expand Up @@ -330,7 +332,9 @@ func (h AdminAPIsHandler) updateSurvey(l *logs.Log, r *http.Request, claims *tok
items.CreatorID = claims.Subject
items.OrgID = claims.OrgID
items.AppID = claims.AppID
items.Type = "user"
if items.Type == "" {
items.Type = "user"
}

item := updateSurveyRequestToSurvey(items, id)

Expand Down

0 comments on commit 9ece47c

Please sign in to comment.