Skip to content

Commit

Permalink
name changed helper to utils
Browse files Browse the repository at this point in the history
  • Loading branch information
alnck committed Feb 14, 2022
1 parent 7053a7d commit bded0e2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/handler/blogHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package handler

import (
"blog-on-containers/entities"
"blog-on-containers/helper"
"blog-on-containers/models"
"blog-on-containers/services"
"blog-on-containers/utils"
"fmt"
"net/http"

Expand All @@ -27,7 +27,7 @@ func CreateStory(context *gin.Context) {
return
}

cu := helper.GetCurrentUser(context)
cu := utils.GetCurrentUser(context)
newStory := entities.NewStory(story.Title, story.Content, cu.ID)

storyService := services.NewStoryService(context)
Expand Down
6 changes: 3 additions & 3 deletions src/services/story-service.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package services

import (
"blog-on-containers/entities"
"blog-on-containers/helper"
"blog-on-containers/models"
"blog-on-containers/repository"
"blog-on-containers/utils"
"time"

"github.com/gin-gonic/gin"
Expand Down Expand Up @@ -52,7 +52,7 @@ func (*StoryService) UpdateStory(story models.StoryRequest) bool {
return false
}

cu := helper.GetCurrentUser(storyContext)
cu := utils.GetCurrentUser(storyContext)

filter := bson.M{"_id": id, "userid": cu.ID}
update := bson.M{
Expand All @@ -75,7 +75,7 @@ func (*StoryService) DeleteStory() bool {
return false
}

cu := helper.GetCurrentUser(storyContext)
cu := utils.GetCurrentUser(storyContext)
filter := bson.M{"_id": id, "userid": cu.ID}

repoStories.DeleteOne(m_COLLECTION_NAME_STORIES, filter)
Expand Down
2 changes: 1 addition & 1 deletion src/helper/contextHelper.go → src/utils/contextUtils.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package helper
package utils

import (
. "blog-on-containers/constants/ProjectContextKeys"
Expand Down

0 comments on commit bded0e2

Please sign in to comment.