From 462edd4e13050d8ca31f290ed0acbcf1f03fb275 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Thu, 20 Oct 2022 11:50:26 +0530 Subject: [PATCH] feat(gui): implement user delete method Signed-off-by: Pranav C --- packages/nc-gui/components/org-user/index.vue | 7 +- .../nocodb/src/lib/meta/api/orgUserApis.ts | 139 +++++++++++------- packages/nocodb/src/lib/models/ProjectUser.ts | 6 + packages/nocodb/src/lib/models/SyncSource.ts | 9 ++ packages/nocodb/src/lib/models/User.ts | 9 +- 5 files changed, 106 insertions(+), 64 deletions(-) diff --git a/packages/nc-gui/components/org-user/index.vue b/packages/nc-gui/components/org-user/index.vue index ef24e8827f..38cfd8d6d8 100644 --- a/packages/nc-gui/components/org-user/index.vue +++ b/packages/nc-gui/components/org-user/index.vue @@ -8,7 +8,7 @@ const { api, isLoading } = useApi() let users = $ref([]) -const currentPage = $ref(1) +let currentPage = $ref(1) const currentLimit = $ref(10) @@ -21,6 +21,7 @@ const pagination = reactive({ pageSize: 10, }) const loadUsers = async (page = currentPage, limit = currentLimit) => { + currentPage = page try { const response: any = await api.orgUsers.list({ query: { @@ -55,6 +56,8 @@ const updateRole = async (userId: string, roles: Role) => { const deleteUser = async (userId: string) => { Modal.confirm({ title: 'Are you sure you want to delete this user?', + type:"warn", + content: 'On deleting, user will remove from from organization and any sync source(Airtable) created by user will get removed', onOk: async () => { try { await api.orgUsers.delete(userId) @@ -94,7 +97,7 @@ const deleteUser = async (userId: string) => { :data-source="users" :pagination="pagination" :loading="isLoading" - @change="loadUsers" + @change="loadUsers($event.current)" >