func (p *postgres) UpdateUser(u *models.User) error {
	ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second)
	defer cancel()

	query := `Update users set first_name = $1, last_name = $2, email = $3, access_level = $4, updated_at = $5`

	_, err := p.DB.ExecContext(ctx, query,
		u.FirstName,
		u.LastName,
		u.Email,
		u.AccessLevel,
		time.Now(),
	)
	if err != nil {
		return err
	}

	return nil
}
// UpdateUser updates a user in the database
UpdateUser updates a user in the database
// UpdateUser updates a user in the database
func (p *postgres) UpdateUser(u *models.User) error {
	ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second)
	defer cancel()
	query := `Update users set first_name = $1, last_name = $2, email = $3, access_level = $4, updated_at = $5`
	_, err := p.DB.ExecContext(ctx, query,
		u.FirstName,
		u.LastName,
		u.Email,
		u.AccessLevel,
		time.Now(),
	)
	if err != nil {
		return err
	}
	return nil
}
func ( p * postgres ) UpdateUser ( u * models . User ) error { ctx , cancel := context . WithTimeout ( context . Background ( ) , 3 * time . Second ) defer cancel ( ) query := `Update users set first_name = $1, last_name = $2, email = $3, access_level = $4, updated_at = $5` _ , err := p . DB . ExecContext ( ctx , query , u . FirstName , u . LastName , u . Email , u . AccessLevel , time . Now ( ) , ) if err != nil { return err } return nil }
UpdateUser updates a user in the database
UpdateUser updates a user in the database