This commit is contained in:
Quan HL
2023-10-23 11:40:33 +07:00
parent 8d4cf9cb2f
commit 4bced4634d
3 changed files with 15 additions and 4 deletions

View File

@@ -1,4 +1,10 @@
import { Application, FetchError, FetchTransport, StatusCodes } from "./types";
import {
Application,
FetchError,
FetchTransport,
Queue,
StatusCodes,
} from "./types";
import { MSG_SOMETHING_WRONG } from "./constants";
import { getAdvancedSettings } from "src/storage";
@@ -134,7 +140,7 @@ export const getApplications = () => {
export const getQueues = () => {
const advancedSettings = getAdvancedSettings();
return getFetch<string[]>(
return getFetch<Queue[]>(
`${advancedSettings.apiServer}/Accounts/${advancedSettings.accountSid}/Queues`
);
};

View File

@@ -29,3 +29,8 @@ export interface Application {
application_sid: string;
name: string;
}
export interface Queue {
name: string;
length: number;
}

View File

@@ -449,8 +449,8 @@ export const Phone = ({
.then(({ json }) => {
resolve(
json.map((q) => ({
name: q,
value: q,
name: `${q.name} (${q.length})`,
value: q.name,
}))
);
})