Skip to content
This repository was archived by the owner on Oct 18, 2024. It is now read-only.

Commit f69ddd7

Browse files
Merge pull request #768 from SuperViz/lab
Lab
2 parents efef5d6 + 6d612a0 commit f69ddd7

File tree

5 files changed

+2
-24
lines changed

5 files changed

+2
-24
lines changed

src/components/comments/index.test.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,7 @@ describe('Comments', () => {
139139
const spy = jest.spyOn(ApiService, 'fetchAnnotation');
140140

141141
expect(spy).toHaveBeenCalledWith(MOCK_CONFIG.apiUrl, MOCK_CONFIG.apiKey, {
142-
roomId: MOCK_CONFIG.roomId,
143-
url: expect.any(String),
142+
roomId: MOCK_CONFIG.roomId
144143
});
145144
});
146145

@@ -161,7 +160,6 @@ describe('Comments', () => {
161160

162161
expect(spy).toHaveBeenCalledWith(MOCK_CONFIG.apiUrl, MOCK_CONFIG.apiKey, {
163162
roomId: MOCK_CONFIG.roomId,
164-
url: expect.any(String),
165163
userId: expect.any(String),
166164
position: expect.any(String),
167165
});

src/components/comments/index.ts

-15
Original file line numberDiff line numberDiff line change
@@ -134,18 +134,6 @@ export class Comments extends BaseComponent {
134134
);
135135
}
136136

137-
/**
138-
* @function url
139-
* @description Gets the URL of the client
140-
* @returns {void}
141-
*/
142-
private get url(): string {
143-
const url = new URL(this.clientUrl);
144-
url.search = '';
145-
146-
return url.toString();
147-
}
148-
149137
/**
150138
* @function start
151139
* @description Initializes the Comments component
@@ -392,15 +380,13 @@ export class Comments extends BaseComponent {
392380
private createAnnotation = async ({ detail }: CustomEvent): Promise<void> => {
393381
try {
394382
const { text, mentions } = detail;
395-
const { url } = this;
396383
const position = { ...this.coordinates };
397384
const annotation = await ApiService.createAnnotations(
398385
config.get<string>('apiUrl'),
399386
config.get<string>('apiKey'),
400387
{
401388
roomId: config.get<string>('roomId'),
402389
position: JSON.stringify(position),
403-
url,
404390
userId: this.localParticipantId,
405391
},
406392
);
@@ -604,7 +590,6 @@ export class Comments extends BaseComponent {
604590

605591
{
606592
roomId: config.get('roomId'),
607-
url: this.url,
608593
},
609594
);
610595

src/services/api/index.test.ts

-2
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ describe('ApiService', () => {
138138
const baseUrl = 'https://dev.nodeapi.superviz.com';
139139
const response = await ApiService.createAnnotations(baseUrl, VALID_API_KEY, {
140140
roomId: 'any_room_id',
141-
url: 'any_url',
142141
position: 'any_position',
143142
userId: 'any_user_id',
144143
});
@@ -162,7 +161,6 @@ describe('ApiService', () => {
162161
const baseUrl = 'https://dev.nodeapi.superviz.com';
163162
const response = await ApiService.fetchAnnotation(baseUrl, VALID_API_KEY, {
164163
roomId: 'any_room_id',
165-
url: 'any_url',
166164
});
167165

168166
expect(response).toEqual([]);

src/services/api/index.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,7 @@ export default class ApiService {
7474
static async fetchAnnotation(baseUrl: string, apiKey: string, query: FetchAnnotationsParams) {
7575
const path = '/annotations';
7676
const url = this.createUrl(baseUrl, path, {
77-
roomId: query.roomId,
78-
url: query.url,
77+
roomId: query.roomId
7978
});
8079
return doRequest(url, 'GET', undefined, { apikey: apiKey });
8180
}

src/services/api/types.ts

-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
export type AnnotationParams = {
22
roomId: string;
3-
url: string;
43
position: string;
54
userId: string;
65
};
@@ -13,7 +12,6 @@ export type CommentParams = {
1312

1413
export type FetchAnnotationsParams = {
1514
roomId: string;
16-
url: string;
1715
}
1816

1917
export type MentionParams = {

0 commit comments

Comments
 (0)