generated from kommitters/.template
-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Remove WriteGithubIssueRequest bot * Fix the github assigness update on notion * Add state manage * Fix rubocop warning * Increase coverage
- Loading branch information
1 parent
40a55af
commit 03654e0
Showing
15 changed files
with
214 additions
and
309 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# frozen_string_literal: true | ||
|
||
require "httparty" | ||
require_relative "request" | ||
|
||
module Utils | ||
module Notion | ||
## | ||
# This module is a Notion utility for fetching record from a database. | ||
# | ||
class FetchDatabaseRecord | ||
# Implements the fetch page process logic to Notion. | ||
# | ||
# <br> | ||
# <b>Params:</b> | ||
# * <tt>database_id</tt> Id of the notion database. | ||
# * <tt>secret</tt> Notion secret. | ||
# * <tt>body</tt> Body with the filters. | ||
# | ||
# <br> | ||
# <b>returns</b> <tt>HTTParty::Response</tt> | ||
# | ||
# | ||
def initialize(options) | ||
@options = options | ||
end | ||
|
||
def execute | ||
records = Utils::Notion::Request.execute(params) | ||
|
||
records.parsed_response["results"] || [] | ||
end | ||
|
||
private | ||
|
||
def params | ||
{ | ||
endpoint: "databases/#{@options[:database_id]}/query", | ||
secret: @options[:secret], | ||
method: "post", | ||
body: @options[:body] | ||
} | ||
end | ||
end | ||
end | ||
end |
Oops, something went wrong.