feat: DM voice (draft)
This commit is contained in:
@@ -19,7 +19,8 @@ import {
|
||||
RenewLicenseResponse,
|
||||
AgoraTokenResponse,
|
||||
AgoraVoicingListResponse,
|
||||
SystemCommon
|
||||
SystemCommon,
|
||||
AgoraChannelUsersResponse
|
||||
} from "../../types/server";
|
||||
import { Channel } from "../../types/channel";
|
||||
import { ContentTypeKey } from "../../types/message";
|
||||
@@ -130,7 +131,8 @@ export const serverApi = createApi({
|
||||
return {
|
||||
id: +id,
|
||||
context,
|
||||
memberCount: count
|
||||
memberCount: count,
|
||||
channelName: data.channel_name
|
||||
};
|
||||
});
|
||||
dispatch(upsertVoiceList(arr));
|
||||
@@ -140,6 +142,15 @@ export const serverApi = createApi({
|
||||
}
|
||||
}
|
||||
}),
|
||||
getAgoraUsersByChannel: builder.query<number[], string>({
|
||||
query: (channel_name) => ({ url: `/admin/agora/channel/user/${channel_name}/false` }),
|
||||
transformResponse: (resp: AgoraChannelUsersResponse) => {
|
||||
if (resp.success && resp.data.channel_exist) {
|
||||
return resp.data.users ?? [];
|
||||
}
|
||||
return [];
|
||||
}
|
||||
}),
|
||||
updateAgoraConfig: builder.mutation<void, AgoraConfig>({
|
||||
query: (data) => ({
|
||||
url: `/admin/agora/config`,
|
||||
@@ -405,5 +416,6 @@ export const {
|
||||
useUpdateSystemCommonMutation,
|
||||
useLazyGetSystemCommonQuery,
|
||||
useGetSystemCommonQuery,
|
||||
useGenerateAgoraTokenMutation
|
||||
useGenerateAgoraTokenMutation,
|
||||
useLazyGetAgoraUsersByChannelQuery
|
||||
} = serverApi;
|
||||
|
||||
Reference in New Issue
Block a user