lib/notion/api/endpoints/pages.rb in notion-ruby-client-1.2.0 vs lib/notion/api/endpoints/pages.rb in notion-ruby-client-1.2.1
- old
+ new
@@ -36,10 +36,13 @@
# specific to the property type, e.g. {"checkbox": true}.
#
# @option options [Object] :children
# An optional array of Block objects representing the Page’s content
def create_page(options = {})
- throw ArgumentError.new('Required argument :parent.database_id missing') if options.dig(:parent, :database_id).nil?
+ if options.dig(:parent, :database_id).nil? && options.dig(:parent, :page_id).nil?
+ throw ArgumentError.new('Required argument :parent.database_id or :parent.page_id required')
+ end
+
post("pages", options)
end
#
# Updates a page by setting the values of any properties specified in the