-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1023 from ds-wizard/release/4.1.0
Release 4.1.0
- Loading branch information
Showing
78 changed files
with
1,316 additions
and
444 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
module Shared.Api.QuestionnaireActions exposing | ||
( getQuestionnaireActions | ||
, getQuestionnaireActionsFor | ||
, putQuestionnaireAction | ||
) | ||
|
||
import Json.Decode as D | ||
import Shared.AbstractAppState exposing (AbstractAppState) | ||
import Shared.Api exposing (ToMsg, jwtGet, jwtPut) | ||
import Shared.Data.Pagination as Pagination exposing (Pagination) | ||
import Shared.Data.PaginationQueryFilters exposing (PaginationQueryFilters) | ||
import Shared.Data.PaginationQueryString as PaginationQueryString exposing (PaginationQueryString) | ||
import Shared.Data.QuestionnaireAction as QuestionnaireAction exposing (QuestionnaireAction) | ||
import Uuid exposing (Uuid) | ||
|
||
|
||
getQuestionnaireActions : PaginationQueryFilters -> PaginationQueryString -> AbstractAppState a -> ToMsg (Pagination QuestionnaireAction) msg -> Cmd msg | ||
getQuestionnaireActions _ qs = | ||
let | ||
queryString = | ||
PaginationQueryString.toApiUrl qs | ||
|
||
url = | ||
"/questionnaire-actions" ++ queryString | ||
in | ||
jwtGet url (Pagination.decoder "questionnaireActions" QuestionnaireAction.decoder) | ||
|
||
|
||
putQuestionnaireAction : QuestionnaireAction -> AbstractAppState a -> ToMsg () msg -> Cmd msg | ||
putQuestionnaireAction questionnaireImporter = | ||
let | ||
body = | ||
QuestionnaireAction.encode questionnaireImporter | ||
in | ||
jwtPut ("/questionnaire-actions/" ++ questionnaireImporter.id) body | ||
|
||
|
||
getQuestionnaireActionsFor : Uuid -> AbstractAppState a -> ToMsg (List QuestionnaireAction) msg -> Cmd msg | ||
getQuestionnaireActionsFor questionnaireUuid = | ||
let | ||
paginationQueryString = | ||
PaginationQueryString.empty | ||
|> PaginationQueryString.withSort (Just "name") PaginationQueryString.SortASC | ||
|
||
queryString = | ||
PaginationQueryString.toApiUrlWith [ ( "questionnaireUuid", Uuid.toString questionnaireUuid ), ( "enabled", "true" ) ] paginationQueryString | ||
|
||
url = | ||
"/questionnaire-actions/suggestions" ++ queryString | ||
in | ||
jwtGet url (D.map .items (Pagination.decoder "questionnaireActions" QuestionnaireAction.decoder)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.