From 17aa04c1ea77d25f3118d28d710df7f55bf05a78 Mon Sep 17 00:00:00 2001 From: Nathan Coad Date: Thu, 11 Jan 2024 15:58:33 +1100 Subject: [PATCH] return secret when creating it --- .drone.yml | 6 +++--- controllers/storeSecrets.go | 2 +- utils/structOperations.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.drone.yml b/.drone.yml index efc40f9..53c9ee7 100644 --- a/.drone.yml +++ b/.drone.yml @@ -103,9 +103,9 @@ steps: - name: rebuild-cache-with-filesystem image: meltwater/drone-cache pull: true - # when: - # event: - # - tag + when: + event: + - tag settings: backend: "filesystem" #debug: true diff --git a/controllers/storeSecrets.go b/controllers/storeSecrets.go index daed340..20597a7 100644 --- a/controllers/storeSecrets.go +++ b/controllers/storeSecrets.go @@ -141,7 +141,7 @@ func StoreSecret(c *gin.Context) { return } - c.JSON(http.StatusOK, gin.H{"message": "secret stored successfully"}) + c.JSON(http.StatusOK, gin.H{"message": "secret stored successfully", "data": s}) } /* diff --git a/utils/structOperations.go b/utils/structOperations.go index af78977..bed0a26 100644 --- a/utils/structOperations.go +++ b/utils/structOperations.go @@ -40,7 +40,7 @@ type Identifiable interface { GetId() int } -// AppendIfNotExists requires a struct to implement the GetId() function +// AppendIfNotExists requires a struct to implement the GetId() method // Then we can use this function to avoid creating duplicate entries in the slice func AppendIfNotExists[T Identifiable](slice []T, element T) []T { for _, existingElement := range slice {