Passed
Pull Request — main (#166)
by Yume
02:10
created

handlers.*PageController.PostClicked   A

Complexity

Conditions 1

Size

Total Lines 4
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
package handlers
2
3
import (
4
	"net/http"
5
6
	"github.com/labstack/echo/v4"
7
	"github.com/memnix/memnix-rest/app/v2/views"
8
)
9
10
type PageController struct{}
11
12
func NewPageController() *PageController {
13
	return &PageController{}
14
}
15
16
func (p *PageController) GetIndex(c echo.Context) error {
17
	page := views.Page("John")
18
19
	return Render(c, http.StatusOK, page)
20
}
21
22
func (p *PageController) PostClicked(c echo.Context) error {
23
	clicked := views.Clicked()
24
25
	return Render(c, http.StatusOK, clicked)
26
}
27