Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add token_info method, bump version #9

Merged
merged 7 commits into from
Jan 3, 2025

Conversation

dmitrytrager
Copy link
Contributor

No description provided.

@dmitrytrager dmitrytrager force-pushed the chore/tiktok-access-lost-DD-4674 branch from 6bbff68 to d491dea Compare December 25, 2024 12:42
@dmitrytrager dmitrytrager requested a review from AlphaB December 25, 2024 12:43
lib/panda/client.rb Outdated Show resolved Hide resolved
def get_token(path, params = {})
request = Panda::HTTPRequest.new('GET', path, params)
response = Panda.make_get_request(request)
response.status == 200 ? response.parsed_body : nil
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no need in checking status, error middleware will handle all non successful requests. Please add a separate structure that wraps raw response from TikTok like we do with collections

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Collection is a wrapper around enumerable with pagination. We don't have pagination here, I can just fetch data from response

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We wrap raw responses from API with our objects. Please, create a response object for this API and return it from this method

@dmitrytrager dmitrytrager force-pushed the chore/tiktok-access-lost-DD-4674 branch 2 times, most recently from 6079de9 to e19b92a Compare December 26, 2024 16:29
@dmitrytrager dmitrytrager force-pushed the chore/tiktok-access-lost-DD-4674 branch from e19b92a to 3ca8cd2 Compare December 26, 2024 16:31
@dmitrytrager dmitrytrager requested a review from AlphaB December 26, 2024 18:35
lib/panda/item.rb Outdated Show resolved Hide resolved
lib/panda/item.rb Outdated Show resolved Hide resolved
@dmitrytrager dmitrytrager force-pushed the chore/tiktok-access-lost-DD-4674 branch from 6b6cb78 to 53f8b9e Compare December 27, 2024 11:36

module Panda
class TokenInfo
attr_reader :data
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we don't use this reader anywhere

@@ -1,6 +1,7 @@
# frozen_string_literal: true

require 'panda/collection'
require 'panda/token_info'
Copy link
Member

@AlphaB AlphaB Dec 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's keep imports sorted as they were

@dmitrytrager dmitrytrager requested a review from AlphaB January 3, 2025 22:30
@dmitrytrager dmitrytrager merged commit 7731456 into main Jan 3, 2025
5 checks passed
@dmitrytrager dmitrytrager deleted the chore/tiktok-access-lost-DD-4674 branch January 3, 2025 22:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants