|
@@ -13,7 +13,7 @@ import (
|
|
|
|
|
|
const errArticleExists = "Статья с данным URL уже существует"
|
|
|
|
|
|
-func ArticleHandler(sp interfaces.IServiceProvider) fiber.Handler {
|
|
|
+func ArticleHandler(sp interfaces.ServiceProvider) fiber.Handler {
|
|
|
return func(ctx *fiber.Ctx) error {
|
|
|
articles, err := sp.GetArticleRepository().GetAll(ctx.Context())
|
|
|
if err != nil {
|
|
@@ -32,7 +32,7 @@ func ArticleHandler(sp interfaces.IServiceProvider) fiber.Handler {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-func AddArticleHandler(sp interfaces.IServiceProvider) fiber.Handler {
|
|
|
+func AddArticleHandler(sp interfaces.ServiceProvider) fiber.Handler {
|
|
|
return func(ctx *fiber.Ctx) error {
|
|
|
var validate = validator.New()
|
|
|
validateErrors := make(map[string]string)
|
|
@@ -111,7 +111,7 @@ func AddArticleHandler(sp interfaces.IServiceProvider) fiber.Handler {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-func EditArticleHandler(sp interfaces.IServiceProvider) fiber.Handler {
|
|
|
+func EditArticleHandler(sp interfaces.ServiceProvider) fiber.Handler {
|
|
|
return func(ctx *fiber.Ctx) error {
|
|
|
var validate = validator.New()
|
|
|
validateErrors := make(map[string]string)
|
|
@@ -241,7 +241,7 @@ func EditArticleHandler(sp interfaces.IServiceProvider) fiber.Handler {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-func DeleteArticleHandler(sp interfaces.IServiceProvider) fiber.Handler {
|
|
|
+func DeleteArticleHandler(sp interfaces.ServiceProvider) fiber.Handler {
|
|
|
return func(ctx *fiber.Ctx) error {
|
|
|
ID, err := strconv.Atoi(ctx.Params("id"))
|
|
|
if err != nil {
|