From 1073148eee5de8d3b8214bf3280618effc011219 Mon Sep 17 00:00:00 2001 From: Varakh Date: Fri, 26 Apr 2024 18:41:00 +0000 Subject: [PATCH] fix(actions): state not considered in test payload (#26) Reviewed-on: https://git.myservermanager.com/varakh/upda/pulls/26 Co-authored-by: Varakh Co-committed-by: Varakh --- _doc/api.yaml | 3 +++ _doc/updaserver.postman_collection.json | 2 +- api/dto.go | 1 + server/api_handler_action_invocation.go | 2 +- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/_doc/api.yaml b/_doc/api.yaml index b741a93..04b5803 100644 --- a/_doc/api.yaml +++ b/_doc/api.yaml @@ -2750,6 +2750,7 @@ components: - provider - host - version + - state properties: application: type: string @@ -2759,6 +2760,8 @@ components: type: string version: type: string + state: + type: string CreateSecretRequest: type: object required: diff --git a/_doc/updaserver.postman_collection.json b/_doc/updaserver.postman_collection.json index ceaf179..9d12248 100644 --- a/_doc/updaserver.postman_collection.json +++ b/_doc/updaserver.postman_collection.json @@ -1506,7 +1506,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"application\": \"Test App\",\n \"host\": \"Test Host\",\n \"provider\": \"Test Provider\",\n \"version\": \"Test Version\"\n}", + "raw": "{\n \"application\": \"Test App\",\n \"host\": \"Test Host\",\n \"provider\": \"Test Provider\",\n \"version\": \"Test Version\",\n \"state\": \"Test State\"\n}", "options": { "raw": { "language": "json" diff --git a/api/dto.go b/api/dto.go index 0a7c9dc..f8c2549 100644 --- a/api/dto.go +++ b/api/dto.go @@ -79,6 +79,7 @@ type TestActionRequest struct { Provider string `json:"provider" binding:"required,min=1"` Host string `json:"host" binding:"required,min=1"` Version string `json:"version" binding:"required,min=1"` + State string `json:"state" binding:"required,min=1"` } type PaginateUpdateRequest struct { diff --git a/server/api_handler_action_invocation.go b/server/api_handler_action_invocation.go index 10dcf35..fbf5a3d 100644 --- a/server/api_handler_action_invocation.go +++ b/server/api_handler_action_invocation.go @@ -30,7 +30,7 @@ func (h *actionInvocationHandler) test(c *gin.Context) { return } - err = h.actionInvocationService.execute(e, &eventPayloadInformationDto{Application: req.Application, Host: req.Host, Provider: req.Provider, Version: req.Version}) + err = h.actionInvocationService.execute(e, &eventPayloadInformationDto{Application: req.Application, Host: req.Host, Provider: req.Provider, Version: req.Version, State: req.State}) isSuccess := err == nil var message string