- Enhanced the web component to include a kick participant feature. - Updated the UI to allow moderators to input participant identity for kicking. - Modified the room controller to handle the new kick participant request. - Refactored code for better readability and maintainability across various services and controllers. - Updated the index.mustache and room.mustache templates to reflect changes in functionality.
40 lines
1.3 KiB
TypeScript
40 lines
1.3 KiB
TypeScript
import { del, get } from '../utils/http';
|
|
// @ts-ignore
|
|
import { MeetRecordingInfo } from '../../../typings/src/recording.model';
|
|
import { configService } from './configService';
|
|
|
|
export const getAllRecordings = async (): Promise<{
|
|
pagination: { isTruncated: boolean; nextPageToken?: string };
|
|
recordings: MeetRecordingInfo[];
|
|
}> => {
|
|
const url = `${configService.meetApiUrl}/recordings`;
|
|
|
|
let { pagination, recordings } = await get<{
|
|
pagination: any;
|
|
recordings: MeetRecordingInfo[];
|
|
}>(url, {
|
|
headers: { 'x-api-key': configService.meetApiKey }
|
|
});
|
|
|
|
while (pagination.isTruncated) {
|
|
const nextPageUrl = `${url}?nextPageToken=${pagination.nextPageToken}`;
|
|
const nextPageResult = await get<{
|
|
pagination: any;
|
|
recordings: MeetRecordingInfo[];
|
|
}>(nextPageUrl, {
|
|
headers: { 'x-api-key': configService.meetApiKey }
|
|
});
|
|
recordings.push(...nextPageResult.recordings);
|
|
pagination = nextPageResult.pagination;
|
|
}
|
|
|
|
return { pagination, recordings };
|
|
};
|
|
|
|
export const deleteAllRecordings = async (recordingIds: string[]): Promise<void> => {
|
|
const url = `${configService.meetApiUrl}/recordings?recordingIds=${recordingIds.join(',')}`;
|
|
await del<void>(url, {
|
|
headers: { 'x-api-key': configService.meetApiKey }
|
|
});
|
|
};
|