Skip to content
This repository has been archived by the owner on Sep 11, 2022. It is now read-only.

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Dusan Malusev committed Mar 13, 2022
1 parent 7d0a676 commit ee1f481
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion backend/pkg/models/participants.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package models

import "time"

type Participant struct {
ID uint64 `gorm:"column:id"`
UserID uint64 `gorm:"column:user_id" json:"user_id,omitempty"`
EventID uint64 `gorm:"column:event_id" json:"event_id,omitempty"`
Status string `gorm:"column:status" json:"status,omitempty"`

CreatedAt time.Time `gorm:"column:created_at"`
User User
Event Event
}
2 changes: 2 additions & 0 deletions backend/pkg/services/event/participant.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package event

import (
"context"
"time"

"github.com/BrosSquad/go-collect/pb"
"github.com/BrosSquad/go-collect/pkg/models"
Expand All @@ -23,6 +24,7 @@ func (service *ParticipantService) Evident(ctx context.Context, request pb.Parti
UserID: request.UserId,
EventID: request.EventId,
Status: "in",
CreatedAt: time.Now(),
}

result := service.db.Save(&model)
Expand Down

0 comments on commit ee1f481

Please sign in to comment.