formatting and update image
This commit is contained in:
parent
5f967bcde1
commit
9ad4170b82
BIN
code.png
BIN
code.png
Binary file not shown.
Before Width: | Height: | Size: 371 KiB After Width: | Height: | Size: 409 KiB |
|
@ -195,7 +195,7 @@ func youtubeServiceForUser(userId primitive.ObjectID) (*youtube.Service, error)
|
|||
}
|
||||
}
|
||||
|
||||
//TODO: Revisit the structure of this function
|
||||
// TODO: Revisit the structure of this function
|
||||
func ScheduleBroadcastFromWebhook(c *gin.Context, body *webhooks.EventDelivery) error {
|
||||
//get uid from context. Lots of sanitizing just incase
|
||||
uid := userIdFromContext(c)
|
||||
|
@ -278,7 +278,7 @@ func ScheduleBroadcastFromWebhook(c *gin.Context, body *webhooks.EventDelivery)
|
|||
}
|
||||
|
||||
//save audit trail
|
||||
err = mongo.SaveModels( actionTaken)
|
||||
err = mongo.SaveModels(actionTaken)
|
||||
if err != nil {
|
||||
log.WithError(err).Error("Failed to save broadcastModel and actionTaken")
|
||||
return err
|
||||
|
|
|
@ -7,7 +7,7 @@ import (
|
|||
)
|
||||
|
||||
func TestPlanEventMatch(t *testing.T) {
|
||||
events := []string{"services.v2.events.plan.updated","services.v2.events.plan.destroyed","services.v2.events.plan.created"}
|
||||
events := []string{"services.v2.events.plan.updated", "services.v2.events.plan.destroyed", "services.v2.events.plan.created"}
|
||||
|
||||
for _, event := range events {
|
||||
assert.Equal(t, eventMatch("plan", event), true)
|
||||
|
|
|
@ -24,7 +24,6 @@ func (api *PcoApiClient) GetSubscriptions() ([]webhooks.Subscription, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
|
||||
if resp.StatusCode > 299 || resp.StatusCode < 200 {
|
||||
if raw, err := io.ReadAll(resp.Body); err == nil {
|
||||
return nil, fmt.Errorf("Failed to retrieve subscriptions with status code: %d. Error %s", resp.StatusCode, string(raw))
|
||||
|
|
|
@ -75,5 +75,4 @@ func TestCreateSubscriptions(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ func InsertBroadcast(service *youtube.Service, title string, startTime time.Time
|
|||
return service.LiveBroadcasts.Insert([]string{"snippet", "status"}, liveBroadcast).Do()
|
||||
}
|
||||
|
||||
//given a broadcast ID update the broadcast
|
||||
// given a broadcast ID update the broadcast
|
||||
func UpdateBroadcast(service *youtube.Service, id, title string, startTime time.Time, privacyStatus string) (*youtube.LiveBroadcast, error) {
|
||||
liveBroadcast := &youtube.LiveBroadcast{
|
||||
Id: id,
|
||||
|
|
|
@ -147,7 +147,7 @@ func setupPcoSubscriptions(user *models.User) error {
|
|||
for index := range builtHooks {
|
||||
err = pcoApi.CreateSubscription(&builtHooks[index])
|
||||
if err != nil {
|
||||
return errors.Join(fmt.Errorf("Failed to create subscription: %s for user: %s", builtHooks[index].Name ,user.Id), err)
|
||||
return errors.Join(fmt.Errorf("Failed to create subscription: %s for user: %s", builtHooks[index].Name, user.Id), err)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -76,4 +76,6 @@ func (db *DB) FindAuditTrailForUser(userId primitive.ObjectID) ([]models.EventRe
|
|||
return events, actions, nil
|
||||
}
|
||||
|
||||
func (db *DB) FindEventRecievedByVendorId(id string) ([]models.EventRecieved) {return []models.EventRecieved{}}
|
||||
func (db *DB) FindEventRecievedByVendorId(id string) []models.EventRecieved {
|
||||
return []models.EventRecieved{}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"webhook_version": "0.0.59",
|
||||
"webhook_version": "0.0.60",
|
||||
"frontend_version": "0.0.40"
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue