From 4bced4634d49f1f3548c48b408e4485247b8a705 Mon Sep 17 00:00:00 2001 From: Quan HL Date: Mon, 23 Oct 2023 11:40:33 +0700 Subject: [PATCH] wip --- src/api/index.ts | 10 ++++++++-- src/api/types.ts | 5 +++++ src/window/phone/index.tsx | 4 ++-- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/api/index.ts b/src/api/index.ts index 533d8ad..c94255a 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -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( + return getFetch( `${advancedSettings.apiServer}/Accounts/${advancedSettings.accountSid}/Queues` ); }; diff --git a/src/api/types.ts b/src/api/types.ts index 2524135..a99625b 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -29,3 +29,8 @@ export interface Application { application_sid: string; name: string; } + +export interface Queue { + name: string; + length: number; +} diff --git a/src/window/phone/index.tsx b/src/window/phone/index.tsx index 89b2c57..cb4f9d6 100644 --- a/src/window/phone/index.tsx +++ b/src/window/phone/index.tsx @@ -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, })) ); })