fix: client file sharing access denied + task/project default tabs
- FileSharing: rootPath for clients strips /Clients/ prefix — API resolveClientPath expects /{company} not /Clients/{company}
- Tasks: default to To Do tab (not_started) instead of All Tasks
- Projects: default to Active tab instead of All Projects
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -270,12 +270,16 @@ async function fbqProxy(op, path, extra = {}) {
|
||||
throw new Error(`Unsupported operation: ${op}`);
|
||||
}
|
||||
|
||||
function safeName(v) {
|
||||
return String(v || '').trim().replace(/[\\/:*?"<>|#%{}^~[\]`]+/g, '-').replace(/\s+/g, ' ').replace(/^-+|-+$/g, '');
|
||||
}
|
||||
|
||||
function rootPath(user) {
|
||||
if (!user || user.role === 'team' || user.role === 'external') return '/';
|
||||
const companies = user.companies?.filter(Boolean) ?? [];
|
||||
if (companies.length > 1) return '/Clients';
|
||||
if (companies.length > 1) return '/';
|
||||
const name = companies[0]?.name ?? user.company?.name;
|
||||
return name ? `/Clients/${name}` : '/';
|
||||
return name ? `/${safeName(name)}` : '/';
|
||||
}
|
||||
|
||||
function parsePath(path) {
|
||||
|
||||
Reference in New Issue
Block a user