diff --git a/packages/nocodb/src/lib/meta/api/viewApis.ts b/packages/nocodb/src/lib/meta/api/viewApis.ts index eb26e825a7..9a7d80872e 100644 --- a/packages/nocodb/src/lib/meta/api/viewApis.ts +++ b/packages/nocodb/src/lib/meta/api/viewApis.ts @@ -34,7 +34,7 @@ export async function viewList( //await View.list(req.params.tableId) const filteredViewList = viewList.filter((view: any) => { return Object.keys((req as any).session?.passport?.user?.roles).some( - role => + (role) => (req as any)?.session?.passport?.user?.roles[role] && !view.disabled[role] ); @@ -69,9 +69,9 @@ export async function viewDelete(req: Request, res: Response, next) { res.json(result); } -async function shareViewPasswordUpdate(req: Request, res) { - Tele.emit('evt', { evt_type: 'sharedView:password-updated' }); - res.json(await View.passwordUpdate(req.params.viewId, req.body)); +async function shareViewUpdate(req: Request, res) { + Tele.emit('evt', { evt_type: 'sharedView:updated' }); + res.json(await View.update(req.params.viewId, req.body)); } async function shareViewDelete(req: Request, res) { @@ -140,7 +140,7 @@ router.post( router.patch( '/api/v1/db/meta/views/:viewId/share', metaApiMetrics, - ncMetaAclMw(shareViewPasswordUpdate, 'shareViewPasswordUpdate') + ncMetaAclMw(shareViewUpdate, 'shareViewUpdate') ); router.delete( '/api/v1/db/meta/views/:viewId/share',