Skip to content

Commit

Permalink
impl: isPublished in questionnaires controller
Browse files Browse the repository at this point in the history
  • Loading branch information
kavos113 committed Oct 24, 2024
1 parent 93705a0 commit 6f70f2d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions controller/questionnaire.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func (q Questionnaire) PostQuestionnaire(c echo.Context, userID string, params o
questionnaireID := 0

err := q.ITransaction.Do(c.Request().Context(), nil, func(ctx context.Context) error {
questionnaireID, err := q.InsertQuestionnaire(ctx, params.Title, params.Description, responseDueDateTime, convertResponseViewableBy(params.ResponseViewableBy))
questionnaireID, err := q.InsertQuestionnaire(ctx, params.Title, params.Description, responseDueDateTime, convertResponseViewableBy(params.ResponseViewableBy), params.IsPublished)
if err != nil {
c.Logger().Errorf("failed to insert questionnaire: %+v", err)
return err
Expand Down Expand Up @@ -302,7 +302,7 @@ func (q Questionnaire) EditQuestionnaire(c echo.Context, questionnaireID int, pa
responseDueDateTime.Time = *params.ResponseDueDateTime
}
err := q.ITransaction.Do(c.Request().Context(), nil, func(ctx context.Context) error {
err := q.UpdateQuestionnaire(ctx, params.Title, params.Description, responseDueDateTime, string(params.ResponseViewableBy), questionnaireID)
err := q.UpdateQuestionnaire(ctx, params.Title, params.Description, responseDueDateTime, string(params.ResponseViewableBy), questionnaireID, params.IsPublished)
if err != nil && !errors.Is(err, model.ErrNoRecordUpdated) {
c.Logger().Errorf("failed to update questionnaire: %+v", err)
return err
Expand Down

0 comments on commit 6f70f2d

Please sign in to comment.