Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

49 refactor #50

Merged
merged 2 commits into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@

Portfolio aims for you to have your personal weblog. It contains the following parts:

1. Home page where you can introduce yourself briefly.
2. Blog page where you can write and show them to people.
3. About Me page where you can write about yourself in detail.
4. Contact page where others can write direct messages for you as an admin.
1. **Home Page:** A space for you to introduce yourself briefly.
2. **Blog Page:** A platform where you can write and showcase your thought to people.
3. **About Me Page:** A detailed section where you can write more about yourself.
4. **Contact Page:** A communication channel where others can write direct messages to you as an admin.

[Here is where you can see how my plans for the project.](https://github.com/users/Milad75Rasouli/projects/5) If you have any suggestions to enhance this project, please feel free to open an issue.

## How To Run It

Expand All @@ -23,7 +25,7 @@ Portfolio aims for you to have your personal weblog. It contains the following p
touch config.toml
```

- Copy the configs into _config.toml_
- Copy the configurations into _config.toml_

```config.toml
debug = true
Expand Down Expand Up @@ -110,8 +112,8 @@ kubectl apply -f deployment.yml
minikube service portfolio-service
```

Then go to the shown address in your browser.
Then, visit the displayed address in your browser.

## Contribution

I'd be happy if you contribute to this project. Please feel free to open issues and send pull requests.
Your contributions to this project are welcome. Please feel free to open issues and send pull requests.
7 changes: 4 additions & 3 deletions internal/handler/control-panel.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ func (cp *ControlPanel) PostDeleteBlog(c fiber.Ctx) error {
return Message(c, errors.New("unable to delete the Blog"))
}
}
return Message(c, errors.New("delete user "+data.Data))
return Message(c, errors.New("delete post "+data.Data))
}

func (cp *ControlPanel) PostCreateBlog(c fiber.Ctx) error {
Expand All @@ -124,7 +124,7 @@ func (cp *ControlPanel) PostCreateBlog(c fiber.Ctx) error {
}
err = blog.Validate()
if err != nil {
cp.Logger.Error("create post error", zap.Error(err))
cp.Logger.Error("create post validation error", zap.Error(err))
return Message(c, err)
}
}
Expand Down Expand Up @@ -234,6 +234,7 @@ func (cp *ControlPanel) PostModifyHome(c fiber.Ctx) error {
}
err = homeRequest.Validate()
if err != nil {
cp.Logger.Error("home parse validation error", zap.Error(err))
return Message(c, err)
}
}
Expand Down Expand Up @@ -272,7 +273,7 @@ func (cp *ControlPanel) PostModifyAboutMe(c fiber.Ctx) error {
aboutMe.Content = aboutMeRequest.Content
cp.DB.UpdateAboutMe(c.Context(), aboutMe)
}
return Message(c, errors.New("updated about-me!"))
return Message(c, errors.New("updated about-me"))
}

func (cp *ControlPanel) Register(g fiber.Router) {
Expand Down
2 changes: 1 addition & 1 deletion internal/request/blog.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type Blog struct {
func (b Blog) Validate() error {
return validation.ValidateStruct(&b,
validation.Field(&b.Title, validation.Required, validation.Length(3, 100)),
validation.Field(&b.Body, validation.Required, validation.Length(100, 10000)),
validation.Field(&b.Body, validation.Required, validation.Length(100, 300000)),
validation.Field(&b.Caption, validation.Required, validation.Length(10, 350)),
)
}
Loading