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

Quick Tags (and Trim Reblogs and Quick Flags PR): tipping status lost #838

Closed
marcustyphoon opened this issue Nov 19, 2022 · 3 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@marcustyphoon
Copy link
Collaborator

marcustyphoon commented Nov 19, 2022

Platform

MacOS 10.15.7 x86

Browser

Ungoogled Chromium v107.0.5304.110

Addon version

v0.21.0

Details

Adding a tag to an original post with Quick Tags turns off tipping on the post; we don't pass through canBeTipped and I guess undefined is falsey.

This presumably technically isn't an issue in Trim Reblogs, since you can't have tipping on a non-original post and you can only run Trim Reblogs on those, but more generally, an audit of passthrough fields that may be missing from our post-editing code seems wise.

For editing a post, all of the request parameters from the NPF Post Creation route are expected (depending on if it's an original post or reblog), along with the Post's ID in the query path. If you are editing a scheduled post, make sure to include its publish_on value.
https://github.com/tumblr/docs/blob/master/api.md#postspost-id---editing-a-post-neue-post-format

can_be_tipped
community_label_categories
has_community_label
hide_trail
interactability_reblog
placement_id (and possibly earned_id?)
send_to_twitter

#827 #839

@marcustyphoon marcustyphoon added the bug Something isn't working label Nov 19, 2022
@marcustyphoon
Copy link
Collaborator Author

marcustyphoon commented Nov 19, 2022

proposal:

import { filterPropsForEditing } from './util/something.js'

const {
  response: {
    tags = [],
    ...rest
  }
} = await apiFetch(`/v2/blog/${uuid}/posts/${postId}`);

tags.push(...tagsToAdd);

try {
  const { response: { displayText } } = await apiFetch(`/v2/blog/${uuid}/posts/${postId}`, {
    method: 'PUT',
    body: {
      ...filterPropsForEditing(rest),
      tags: tags.join(','),
    }
  });
}

@marcustyphoon

This comment was marked as off-topic.

@marcustyphoon marcustyphoon self-assigned this Nov 22, 2022
@marcustyphoon marcustyphoon added the help wanted Extra attention is needed label Nov 22, 2022
@marcustyphoon marcustyphoon removed the help wanted Extra attention is needed label Jan 5, 2023
@marcustyphoon
Copy link
Collaborator Author

Fixed by #879, though I still think this should be fixed in Tumblr's back end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant