event changes
parent
6eef0934d5
commit
e2f8970e6c
|
|
@ -75,10 +75,10 @@ func GetAllEvents(c *fiber.Ctx) error {
|
|||
|
||||
var events []models.Event
|
||||
|
||||
// _, err := utils.ProcessToken(c)
|
||||
// if err != nil {
|
||||
// return fiber.ErrUnauthorized
|
||||
// }
|
||||
_, err := utils.ProcessToken(c)
|
||||
if err != nil {
|
||||
return fiber.ErrUnauthorized
|
||||
}
|
||||
|
||||
database.DB.Find(&events)
|
||||
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ func ConnectDB() error {
|
|||
|
||||
user := models.User{
|
||||
Name: "Pcast Admin",
|
||||
Email: "pcast@pcast.com.br",
|
||||
Email: "pcast@pcastive.com",
|
||||
CompanyName: "PCast",
|
||||
Password: passwd,
|
||||
Channel: "pcast",
|
||||
|
|
|
|||
|
|
@ -8,6 +8,6 @@ type Event struct {
|
|||
Description string `gorm:"not null" json:"description"`
|
||||
ExpectedDate time.Time `gorm:"not null" json:"startDt"`
|
||||
UserId uint `gorm:"size:40;not null" json:"user"`
|
||||
EventType string `gorm:"size:1;not null;default:O" json:"eventtype"` // O = Open, C = Closed
|
||||
EventType string `gorm:"size:1;not null;default:O" json:"eventtype"` // T = Test, N = Normal
|
||||
Transmitted string `gorm:"size:1;not null;default:N" json:"transmitted"` // Y = Already transmitted, N = Not transmitted yet
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ func Setup(app *fiber.App) {
|
|||
|
||||
app.Post("/login", controllers.Login)
|
||||
app.Post("/register", controllers.AddUser)
|
||||
app.Get("/events", controllers.GetAllEvents)
|
||||
|
||||
// Webhooks
|
||||
app.Post("/on_server_start", controllers.ServerStart)
|
||||
|
|
|
|||
Loading…
Reference in New Issue