20 lines
721 B
TypeScript
20 lines
721 B
TypeScript
// P4 Tasks (AK-P4b) — pure route-path builders for Tasks URLs. The loader builds
|
|
// these and passes them into the View-Models so the VMs stay routing-agnostic.
|
|
|
|
export function tasksListPath(tenantSlug: string): string {
|
|
return `/${tenantSlug}/tasks`;
|
|
}
|
|
|
|
export function tasksDetailPath(tenantSlug: string, taskId: string): string {
|
|
return `/${tenantSlug}/tasks/${taskId}`;
|
|
}
|
|
|
|
export function tasksNewPath(tenantSlug: string, prefill?: { entityType: string; entityId: string }): string {
|
|
const base = `/${tenantSlug}/tasks/new`;
|
|
if (!prefill) {
|
|
return base;
|
|
}
|
|
const query = new URLSearchParams({ entityType: prefill.entityType, entityId: prefill.entityId });
|
|
return `${base}?${query.toString()}`;
|
|
}
|