Skip to content

Commit

Permalink
function becomes local
Browse files Browse the repository at this point in the history
  • Loading branch information
llemeurfr committed Aug 21, 2023
1 parent d4d4ba7 commit d931ca2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions pkg/api/publication.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ type Category struct {
}

type Publication struct {
Title string `json:"title"`
UUID string `json:"uuid" validate:"omitempty,uuid4_rfc4122"`
Title string `json:"title"`
DatePublication time.Time `json:"datePublication"`
Description string `json:"description"`
CoverUrl string `json:"coverUrl"`
Expand Down Expand Up @@ -149,7 +149,7 @@ func convertPublicationToStor(convertedPublication Publication, originalPublicat
{"name": "Test Category B"}
]
}' \
http://localhost:8080/api/v1/publication
http://localhost:8080/api/v1/publications
*/

type ErrorResponse string
Expand Down
8 changes: 4 additions & 4 deletions pkg/api/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func ConvertUserFromUserStor(u stor.User) *User {
}
}

func ConvertUserToUserStor(u User, originalUser *stor.User) *stor.User {
func convertUserToUserStor(u User, originalUser *stor.User) *stor.User {
if originalUser == nil {
originalUser = &stor.User{}
}
Expand Down Expand Up @@ -72,7 +72,7 @@ func ConvertUserToUserStor(u User, originalUser *stor.User) *stor.User {
"password": "password123",
"lcpHintMsg": "Hint",
"lcpPassHash": "hash123"
}' http://localhost:8080/api/v1/user
}' http://localhost:8080/api/v1/users
*/

// @Summary Create a new user
Expand Down Expand Up @@ -113,7 +113,7 @@ func (api *Api) createUserHandler(w http.ResponseWriter, r *http.Request) {
}

// Convert the view model user to the storage user
storUser := ConvertUserToUserStor(viewUser, &stor.User{})
storUser := convertUserToUserStor(viewUser, &stor.User{})

// Call your storage function to create the user
err = api.stor.CreateUser(storUser)
Expand Down Expand Up @@ -205,7 +205,7 @@ func (api *Api) updateUserHandler(w http.ResponseWriter, r *http.Request) {

fmt.Println(user)

storUserConverted := ConvertUserToUserStor(user, storUser)
storUserConverted := convertUserToUserStor(user, storUser)

fmt.Println(storUserConverted)

Expand Down

0 comments on commit d931ca2

Please sign in to comment.