Skip to content

Commit 2f320ab

Browse files
authored
Merge pull request #68 from CodeChefVIT/abhinav/ideaSubmissionResponse
chore: changed submit idea response
2 parents a3ac6e7 + 5fc059c commit 2f320ab

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

pkg/controller/ideas.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"net/http"
88

99
"github.com/CodeChefVIT/devsoc-be-24/pkg/db"
10+
"github.com/CodeChefVIT/devsoc-be-24/pkg/dto"
1011
logger "github.com/CodeChefVIT/devsoc-be-24/pkg/logging"
1112
"github.com/CodeChefVIT/devsoc-be-24/pkg/models"
1213
"github.com/CodeChefVIT/devsoc-be-24/pkg/utils"
@@ -170,8 +171,11 @@ func GetIdea(c echo.Context) error {
170171
return c.JSON(http.StatusOK, &models.Response{
171172
Status: "success",
172173
Message: "ideas fetched successfully",
173-
Data: map[string]interface{}{
174-
"ideas": ideas,
174+
Data: dto.Idea{
175+
Title: ideas.Title,
176+
Description: ideas.Description,
177+
Track: ideas.Track,
178+
175179
},
176180
})
177181
}

pkg/dto/idea.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package dto
2+
3+
type Idea struct {
4+
Title string `json:"title"`
5+
Description string `json:"description"`
6+
Track string `json:"track"`
7+
}

0 commit comments

Comments
 (0)