fix: post reshare and audio player enhancements
This commit is contained in:
+18
-10
@@ -62,16 +62,21 @@ export type Post = {
|
||||
author_name?: string;
|
||||
author_handle?: string;
|
||||
author_avatar_url?: string | null;
|
||||
/** True when the calling viewer has reshared this post. Populated by
|
||||
* endpoints that go through OptionalAuth (single post, profile feed,
|
||||
* collection contents). Always false / absent for anonymous viewers.
|
||||
* Drives the post-card "Reshare ↔ Send" swap. */
|
||||
/** True when the calling viewer has reshared the canonical version
|
||||
* of this post. Populated by endpoints that go through OptionalAuth
|
||||
* (single post, profile feed, collection contents). Always false /
|
||||
* absent for anonymous viewers. Drives the post-card "Reshare ↔ Send"
|
||||
* swap. */
|
||||
viewer_has_reshared?: boolean;
|
||||
/** Non-null only on rows that appear in a profile feed because the
|
||||
* profile owner reshared them. Drives the "↻ Reshared" header in
|
||||
* the post card and the COALESCE(reshared_at, created_at) sort on
|
||||
* the BFF. Authored posts leave this null. */
|
||||
reshared_at?: string | null;
|
||||
/** Non-null only when this row is itself a reshare — points at the
|
||||
* canonical original. The four `original_author_*` fields carry the
|
||||
* canonical author's profile info for rendering the
|
||||
* "Reshared from @handle" link in the card. Authored canonical posts
|
||||
* leave all of these null/absent. */
|
||||
reshared_from_post_id?: string | null;
|
||||
original_author_name?: string | null;
|
||||
original_author_handle?: string | null;
|
||||
original_author_avatar_url?: string | null;
|
||||
};
|
||||
|
||||
export type Bookmark = {
|
||||
@@ -153,8 +158,11 @@ export const posts = {
|
||||
* side. Resharing your own post is rejected with 400 (not currently
|
||||
* surfaced as a distinct error type because the UI only ever offers
|
||||
* Reshare on non-owned posts). */
|
||||
/** Materialise a reshare. Returns the new post (or the existing
|
||||
* reshare row if the caller already reshared this canonical), so
|
||||
* callers can drop it straight into local feed state. */
|
||||
reshare(id: string) {
|
||||
return call<void>(`/posts/${id}/reshare`, { method: "POST" });
|
||||
return call<Post>(`/posts/${id}/reshare`, { method: "POST" });
|
||||
},
|
||||
/** Remove a previously recorded reshare. Idempotent. */
|
||||
unreshare(id: string) {
|
||||
|
||||
Reference in New Issue
Block a user