From 57f8ae40a3feebd7da8638b2ff41a18442e624ad Mon Sep 17 00:00:00 2001 From: Ramesh Mane <101566080+rameshmane7218@users.noreply.github.com> Date: Tue, 12 Dec 2023 14:01:20 +0530 Subject: [PATCH] fix: lint error --- packages/nc-gui/components/account/Token.vue | 54 ++++++++++---------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/packages/nc-gui/components/account/Token.vue b/packages/nc-gui/components/account/Token.vue index 1290ec4730..8dcf4f99c4 100644 --- a/packages/nc-gui/components/account/Token.vue +++ b/packages/nc-gui/components/account/Token.vue @@ -62,38 +62,12 @@ const hideOrShowToken = (tokenId: string) => { } } -const loadTokens = async (page = currentPage.value, limit = currentLimit.value) => { - currentPage.value = page - try { - const response: any = await api.orgTokens.list({ - query: { - limit, - offset: searchText.value.length === 0 ? (page - 1) * limit : 0, - }, - } as RequestParams) - if (!response) return - - pagination.total = response.pageInfo.totalRows ?? 0 - pagination.pageSize = 10 - - tokens.value = response.list as IApiTokenInfo[] - - if (!allTokens.value.length) { - await loadAllTokens(pagination.total) - } - } catch (e: any) { - message.error(await extractSdkResponseErrorMsg(e)) - } -} - -loadTokens() - // To set default next token name we should need to fetch all token first const loadAllTokens = async (limit = pagination.total) => { try { const response: any = await api.orgTokens.list({ query: { - limit: limit, + limit, }, } as RequestParams) if (!response) return @@ -120,6 +94,32 @@ const updateAllTokens = (type: 'delete' | 'add', token: IApiTokenInfo) => { setDefaultTokenName() } +const loadTokens = async (page = currentPage.value, limit = currentLimit.value) => { + currentPage.value = page + try { + const response: any = await api.orgTokens.list({ + query: { + limit, + offset: searchText.value.length === 0 ? (page - 1) * limit : 0, + }, + } as RequestParams) + if (!response) return + + pagination.total = response.pageInfo.totalRows ?? 0 + pagination.pageSize = 10 + + tokens.value = response.list as IApiTokenInfo[] + + if (!allTokens.value.length) { + await loadAllTokens(pagination.total) + } + } catch (e: any) { + message.error(await extractSdkResponseErrorMsg(e)) + } +} + +loadTokens() + const isModalOpen = ref(false) const tokenDesc = ref('') const tokenToCopy = ref('')