Skip to content

Commit 0b20432

Browse files
author
Rafael Marinho
committed
fix(CHA-769): remove generics
1 parent 3a945ff commit 0b20432

File tree

2 files changed

+17
-10
lines changed

2 files changed

+17
-10
lines changed

src/client.ts

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ import type {
118118
ListCommandsResponse,
119119
ListImportsPaginationOptions,
120120
ListImportsResponse,
121+
LiveLocation,
122+
LiveLocationsAPIResponse,
121123
LocalMessage,
122124
Logger,
123125
MarkChannelsReadOptions,
@@ -2493,7 +2495,9 @@ export class StreamChat {
24932495
* @returns {Promise<APIResponse>} The server response
24942496
*/
24952497
async getUserLiveLocations(userId: string) {
2496-
return await this.get<LiveLocationsAPIResponse>(this.baseURL + `/users/${encodeURIComponent(userId)}/live_locations`);
2498+
return await this.get<LiveLocationsAPIResponse>(
2499+
this.baseURL + `/users/${encodeURIComponent(userId)}/live_locations`,
2500+
);
24972501
}
24982502

24992503
/** muteUser - mutes a user
@@ -4420,12 +4424,15 @@ export class StreamChat {
44204424
* @returns {Promise<APIResponse>} The server response
44214425
*/
44224426
async updateLiveLocation(liveLocation: LiveLocation) {
4423-
return await this.put<LiveLocation<StreamChatGenerics>>(this.baseURL + '/users/' + this.userID + '/live_location', {
4424-
message_id: liveLocation.message_id,
4425-
longitude: liveLocation.longitude,
4426-
latitude: liveLocation.latitude,
4427-
created_by_device_id: liveLocation.created_by_device_id,
4428-
end_at: liveLocation.end_at,
4429-
});
4427+
return await this.put<LiveLocation>(
4428+
this.baseURL + '/users/' + this.userID + '/live_location',
4429+
{
4430+
message_id: liveLocation.message_id,
4431+
longitude: liveLocation.longitude,
4432+
latitude: liveLocation.latitude,
4433+
created_by_device_id: liveLocation.created_by_device_id,
4434+
end_at: liveLocation.end_at,
4435+
},
4436+
);
44304437
}
44314438
}

src/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2713,7 +2713,7 @@ export type MessageBase = CustomMessageData & {
27132713
type?: MessageLabel;
27142714
user?: UserResponse | null;
27152715
user_id?: string;
2716-
live_location?: LiveLocation<StreamChatGenerics>;
2716+
live_location?: LiveLocation;
27172717
};
27182718

27192719
export type MessageLabel =
@@ -3926,7 +3926,7 @@ export type LiveLocationsAPIResponse = APIResponse & {
39263926
live_locations: LiveLocation[];
39273927
};
39283928

3929-
export type LiveLocation<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = {
3929+
export type LiveLocation = {
39303930
channel_cid?: string;
39313931
created_at?: string;
39323932
created_by_device_id: string;

0 commit comments

Comments
 (0)