fix: post reshare and audio player enhancements

This commit is contained in:
gosangam
2026-06-03 14:41:34 +05:30
parent ddc6d3c7bf
commit 48dd450a15
5 changed files with 266 additions and 87 deletions
+18 -10
View File
@@ -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) {