Skip to content

Commit cb3ba64

Browse files
author
Ed Bennigsen
committed
Merge in draft publishing into price plan registering
2 parents 42b625a + 01ec7d0 commit cb3ba64

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

bin/console

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
require "bundler/setup"
44
require "prayermate_api"
5+
require "securerandom"
56

67
# You can add fixtures and/or initialization code here to make experimenting
78
# with your gem easier. You can also use a different console, if you like.
@@ -10,7 +11,17 @@ PROTOCOL = "http"
1011
HOST = "localhost:3000"
1112
API_KEY = ENV["PRAYERMATE_API_KEY"]
1213

14+
EMAIL = ENV["EMAIL_FOR_TOKEN"]
15+
API_TOKEN = ENV["PRAYERMATE_API_TOKEN"]
16+
1317
@api_without_session = PrayerMateApi.api PROTOCOL, HOST, API_KEY
18+
@api = PrayerMateApi.api PROTOCOL, HOST, API_KEY, PrayerMateApi.build_session(EMAIL, API_TOKEN)
19+
20+
@petition = {
21+
date: Date.today,
22+
description: "test petition",
23+
uid: SecureRandom.uuid
24+
}
1425

1526
# (If you use this, don't forget to add pry to your Gemfile!)
1627
# require "pry"

lib/prayermate_api.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,15 @@ def register_with_price_plan(price_plan, first_name, last_name, email, roles)
4949
end
5050

5151

52-
def update_input_feed(feed_id, user_feed_slug, petitions, last_modified)
52+
def update_input_feed(feed_id, user_feed_slug, petitions, last_modified, publish_as_draft = false)
5353
post_with_auth("input_feeds/process", {
5454
feed: {
5555
id: feed_id,
5656
user_feed_slug: user_feed_slug,
5757
last_modified: last_modified
5858
},
59-
petitions: petitions
59+
petitions: petitions,
60+
publish_as_draft: publish_as_draft
6061
})
6162
end
6263

0 commit comments

Comments
 (0)