Browse Source

refactor: project user api path correction

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/1668/head
Pranav C 3 years ago
parent
commit
2a58c82b80
  1. 4
      packages/nc-gui/plugins/tele.js
  2. 11
      packages/nocodb/src/lib/noco/meta/api/projectUserApis.ts

4
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,

11
packages/nocodb/src/lib/noco/meta/api/projectUserApis.ts

@ -249,17 +249,20 @@ async function resendInvite(req, res, next): Promise<any> {
}
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;

Loading…
Cancel
Save