-
Notifications
You must be signed in to change notification settings - Fork 23
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
API to get, follow and unfollow tags #150
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Brilliant 🙏
/// - Parameter id: Name of the tag. | ||
@discardableResult | ||
func followTag(_ id: String) async throws -> Tag { | ||
let req = HTTPRequestBuilder { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method is supported only by Mastodon and Friendica, we need a guard for the flavour.
@discardableResult | ||
func unfollowTag(_ id: String) async throws -> Tag { | ||
let req = HTTPRequestBuilder { | ||
$0.url = getURL(["api", "v1", "tags", id, "unfollow"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, only masto and Friendica
@Tunous Looks great! If you could you add a guard for the flavour of the follow/unfollow methods then it will be ready to merge 🚀. Thanks a lot! 🙌 |
@kkostov Good find. This also gives me an idea that I should hide that function from the app UI. I added a property to tell if the feature is supported to be able to do that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Tunous Nice! I like the availability flag a lot! (@davidgarywood)
No description provided.