fix mistake
This commit is contained in:
@@ -8,7 +8,6 @@ import (
|
|||||||
"github.com/hashicorp/go-set"
|
"github.com/hashicorp/go-set"
|
||||||
"github.com/labstack/echo/v4"
|
"github.com/labstack/echo/v4"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func (h *Handler) CreateEvent(c echo.Context) (err error) {
|
func (h *Handler) CreateEvent(c echo.Context) (err error) {
|
||||||
@@ -91,7 +90,7 @@ func (h *Handler) GetEvents(c echo.Context) (err error) {
|
|||||||
func (h *Handler) GetEvent(c echo.Context) error {
|
func (h *Handler) GetEvent(c echo.Context) error {
|
||||||
var event model.Event
|
var event model.Event
|
||||||
id := c.Param("id")
|
id := c.Param("id")
|
||||||
orgId, err := strconv.Atoi(c.Request().Header.Get("UserOrganizationId"))
|
orgId, err := uuid.Parse(c.Request().Header.Get("UserOrganizationId"))
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return c.NoContent(http.StatusUnauthorized)
|
return c.NoContent(http.StatusUnauthorized)
|
||||||
@@ -120,7 +119,7 @@ func (h *Handler) GetEvent(c echo.Context) error {
|
|||||||
|
|
||||||
func (h *Handler) DeleteEvent(c echo.Context) error {
|
func (h *Handler) DeleteEvent(c echo.Context) error {
|
||||||
id := c.Param("id")
|
id := c.Param("id")
|
||||||
orgId, err := strconv.Atoi(c.Request().Header.Get("UserOrganizationId"))
|
orgId, err := uuid.Parse(c.Request().Header.Get("UserOrganizationId"))
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return c.NoContent(http.StatusUnauthorized)
|
return c.NoContent(http.StatusUnauthorized)
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type Event struct {
|
type Event struct {
|
||||||
ID uuid.UUID `gorm:"type:uuid;default:gen_random_uuid();primarykey"`
|
|
||||||
gorm.Model
|
gorm.Model
|
||||||
|
ID uuid.UUID `gorm:"type:uuid;default:gen_random_uuid();primarykey"`
|
||||||
Start time.Time `json:"start"`
|
Start time.Time `json:"start"`
|
||||||
End time.Time `json:"end"`
|
End time.Time `json:"end"`
|
||||||
Author User `json:"author" gorm:"-"`
|
Author User `json:"author" gorm:"-"`
|
||||||
|
|||||||
Reference in New Issue
Block a user