diff --git a/backend/api/restock.go b/backend/api/restock.go index 6180de8..96f6253 100644 --- a/backend/api/restock.go +++ b/backend/api/restock.go @@ -76,7 +76,6 @@ func (s *Server) CreateRestock(c echo.Context) error { CreatedBy: usr.Id, CreatedByName: usr.Name(), }, - CreatedAt: time.Now().Unix(), } _, err = s.DBackend.WithTransaction(c.Request().Context(), func(ctx mongo.SessionContext) (interface{}, error) { diff --git a/backend/internal/db/mongo/restock_crud.go b/backend/internal/db/mongo/restock_crud.go index 3300eb8..56ad389 100644 --- a/backend/internal/db/mongo/restock_crud.go +++ b/backend/internal/db/mongo/restock_crud.go @@ -14,7 +14,7 @@ func (b *Backend) CreateRestock(ctx context.Context, tx *models.Restock) error { ctx, cancel := b.TimeoutContext(ctx) defer cancel() - tx.CreatedAt = time.Now().Unix() + tx.CreatedAt = uint64(time.Now().Unix()) _, err := b.db.Collection(RestocksCollection).InsertOne(ctx, tx) if err != nil { diff --git a/backend/internal/models/restocks.go b/backend/internal/models/restocks.go index c6cf119..133a662 100644 --- a/backend/internal/models/restocks.go +++ b/backend/internal/models/restocks.go @@ -11,8 +11,6 @@ type ( Restock struct { PrivateID primitive.ObjectID `bson:"_id,omitempty" json:"-"` autogen.Restock `bson:",inline"` - - CreatedAt int64 `bson:"created_at" json:"created_at"` } )