From 2a58c82b808593d13451af2e86758ecff17d0bd4 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Tue, 12 Apr 2022 09:51:41 +0530 Subject: [PATCH] refactor: project user api path correction Signed-off-by: Pranav C --- packages/nc-gui/plugins/tele.js | 4 ++-- .../nocodb/src/lib/noco/meta/api/projectUserApis.ts | 11 +++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/packages/nc-gui/plugins/tele.js b/packages/nc-gui/plugins/tele.js index 113f52bad7..1e63e1341a 100644 --- a/packages/nc-gui/plugins/tele.js +++ b/packages/nc-gui/plugins/tele.js @@ -14,8 +14,8 @@ export default function({ socket.disconnect() } const isUrl = $axios.defaults.baseURL.startsWith('http') - const url = isUrl ? $axios.defaults.baseURL : window.location.href.split(/[?#]/)[0] - const path = isUrl ? undefined : $axios.defaults.baseURL + const url = isUrl ? $axios.defaults.baseURL : window.location.origin + const path = isUrl ? undefined : ($axios.defaults.baseURL === '..' ? window.location.path.split('/').slice(0, -1).join('/') : $axios.defaults.baseURL) socket = io(url, { path, diff --git a/packages/nocodb/src/lib/noco/meta/api/projectUserApis.ts b/packages/nocodb/src/lib/noco/meta/api/projectUserApis.ts index ecd05c3dc5..ef49ce723e 100644 --- a/packages/nocodb/src/lib/noco/meta/api/projectUserApis.ts +++ b/packages/nocodb/src/lib/noco/meta/api/projectUserApis.ts @@ -249,17 +249,20 @@ async function resendInvite(req, res, next): Promise { } const router = Router({ mergeParams: true }); -router.get('/projects/:projectId/users', ncMetaAclMw(userList, 'userList')); +router.get( + '/api/v1/db/meta/projects/:projectId/users', + ncMetaAclMw(userList, 'userList') +); router.post( - '/projects/:projectId/users', + '/api/v1/db/meta/projects/:projectId/users', ncMetaAclMw(userInvite, 'userInvite') ); router.patch( - '/projects/:projectId/users/:userId', + '/api/v1/db/meta/projects/:projectId/users/:userId', ncMetaAclMw(projectUserUpdate, 'projectUserUpdate') ); router.delete( - '/projects/:projectId/users/:userId', + '/api/v1/db/meta/projects/:projectId/users/:userId', ncMetaAclMw(projectUserDelete, 'projectUserDelete') ); export default router;