Skip to content

Commit 886cc5a

Browse files
committed
Add entity id to replies and small fixes
1 parent 657161f commit 886cc5a

File tree

5 files changed

+24
-2
lines changed

5 files changed

+24
-2
lines changed

packages/common/src/api/tan-query/useUserByParams.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export const useUserByParams = (params: UserParams, options?: QueryOptions) => {
3636

3737
useEffect(() => {
3838
if (isSuccess && userIdResult && handleResult) {
39-
dispatch(fetchProfileSucceeded(handleResult, userIdResult, false))
39+
dispatch(fetchProfileSucceeded(handleResult, userIdResult, true))
4040
}
4141
}, [isSuccess, userIdResult, dispatch, handleResult])
4242

packages/discovery-provider/src/api/v1/models/comments.py

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
"reply_comment",
1313
{
1414
"id": fields.String(required=True),
15+
"entity_id": fields.String(required=True),
16+
"entity_type": fields.String(required=True),
1517
"user_id": fields.String(required=True),
1618
"message": fields.String(required=True),
1719
"mentions": fields.List(

packages/discovery-provider/src/queries/get_comments.py

+2
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,8 @@ def filter_mentions(mention):
149149
{
150150
"id": encode_int_id(reply.comment_id),
151151
"user_id": encode_int_id(reply.user_id),
152+
"entity_id": encode_int_id(reply.entity_id),
153+
"entity_type": reply.entity_type,
152154
"message": reply.text,
153155
"mentions": list(map(remove_delete, filter(filter_mentions, mentions))),
154156
"track_timestamp_s": reply.track_timestamp_s,

packages/sdk/src/sdk/api/generated/default/models/ReplyComment.ts

+18
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,18 @@ export interface ReplyComment {
3333
* @memberof ReplyComment
3434
*/
3535
id: string;
36+
/**
37+
*
38+
* @type {string}
39+
* @memberof ReplyComment
40+
*/
41+
entityId: string;
42+
/**
43+
*
44+
* @type {string}
45+
* @memberof ReplyComment
46+
*/
47+
entityType: string;
3648
/**
3749
*
3850
* @type {string}
@@ -101,6 +113,8 @@ export interface ReplyComment {
101113
export function instanceOfReplyComment(value: object): value is ReplyComment {
102114
let isInstance = true;
103115
isInstance = isInstance && "id" in value && value["id"] !== undefined;
116+
isInstance = isInstance && "entityId" in value && value["entityId"] !== undefined;
117+
isInstance = isInstance && "entityType" in value && value["entityType"] !== undefined;
104118
isInstance = isInstance && "userId" in value && value["userId"] !== undefined;
105119
isInstance = isInstance && "message" in value && value["message"] !== undefined;
106120
isInstance = isInstance && "reactCount" in value && value["reactCount"] !== undefined;
@@ -121,6 +135,8 @@ export function ReplyCommentFromJSONTyped(json: any, ignoreDiscriminator: boolea
121135
return {
122136

123137
'id': json['id'],
138+
'entityId': json['entity_id'],
139+
'entityType': json['entity_type'],
124140
'userId': json['user_id'],
125141
'message': json['message'],
126142
'mentions': !exists(json, 'mentions') ? undefined : ((json['mentions'] as Array<any>).map(CommentMentionFromJSON)),
@@ -144,6 +160,8 @@ export function ReplyCommentToJSON(value?: ReplyComment | null): any {
144160
return {
145161

146162
'id': value.id,
163+
'entity_id': value.entityId,
164+
'entity_type': value.entityType,
147165
'user_id': value.userId,
148166
'message': value.message,
149167
'mentions': value.mentions === undefined ? undefined : ((value.mentions as Array<any>).map(CommentMentionToJSON)),

packages/web/src/utils/route.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export const fullAiPage = (handle: string) => {
3535
}
3636

3737
export const fullCommentHistoryPage = (handle: string) => {
38-
return `${fullProfilePage(handle)}/comments`
38+
return `${profilePage(handle)}/comments`
3939
}
4040

4141
export const albumPage = (handle: string, title: string, id: ID) => {

0 commit comments

Comments
 (0)