-
Notifications
You must be signed in to change notification settings - Fork 5
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
Merge Ratings into AtlText #595
Merge Ratings into AtlText #595
Conversation
This reverts commit 242ccf1.
Generated by 🚫 Danger |
📲 You can test the changes from this Pull Request in Gravatar Prototype Build by scanning the QR code below to install the corresponding build.
|
package func update(_ altText: String?, rating: AvatarRating?, avatarID: String, accessToken: String) async throws { | ||
@discardableResult | ||
package func update( | ||
_ altText: String?, |
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.
_ altText: String?, | |
altText: String?, |
Now that we have multiple parameters that we can "update", I think the calling site might read better if we name the first parameter. What do you think?
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.
Let's go with this change 👍
rating: AvatarRating?, | ||
avatarID: String, | ||
accessToken: String | ||
) async throws -> Avatar { |
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.
We don't currently use this return data. But since the API defines a return type for this, I thought we probably should return it, and make it @discardableRersult.
That does mean that if we can't decode it (which I would expect to be quite rare since it would be a backend error that breaks the API), this will throw an error.
What do you think?
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.
Eventually, if (when?) we make this part of the API public, we can follow the pattern of:
public update(::::) --> AvatarType
package update(::::) --> Avatar
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.
Sounds good! 👍
@@ -337,6 +338,7 @@ class AvatarPickerViewModel: ObservableObject { | |||
await profile | |||
} | |||
|
|||
@discardableResult |
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.
Reasonable? Or do we want to check the result?
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.
Looks super good!
Thank you for helping with the merge 🙏
rating: AvatarRating?, | ||
avatarID: String, | ||
accessToken: String | ||
) async throws -> Avatar { |
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.
Sounds good! 👍
package func update(_ altText: String?, rating: AvatarRating?, avatarID: String, accessToken: String) async throws { | ||
@discardableResult | ||
package func update( | ||
_ altText: String?, |
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.
Let's go with this change 👍
86d708c
into
etoledom/alt-text-editor
Description
Now that #589 (QE: Avatar Rating) PR just merged into
trunk
, this mergestrunk
back into #590 (AltText Editor).trunk
(including the new Avatar Rating capability).altText
into the new Menu structuresetRating(_ rating: AvatarRating, for avatar: AvatarImageModel) async
-->update(_ avatar: AvatarImageModel, rating: AvatarRating) async -> Bool
update()
functions@discardableResult
AvatarService.update(::::)
AvatarPickerViewModel.update(_: altText)
AvatarPickerViewModel.update(_: rating)
ProfileService.setRating(:::)
function in favor of theAvatarService.update(::::)
function in the AltText PRTesting Steps