fix: register errand router in appRouter and fix build errors
errandProcedures was defined but never imported/spread into the app router, causing "No procedure found on path errand.create". Also fixed nullable projectId TS errors in delete/abandon and added missing sendUserMessage to test mocks.
This commit is contained in:
@@ -350,12 +350,14 @@ export function errandProcedures(publicProcedure: ProcedureBuilder) {
|
||||
}
|
||||
|
||||
// Remove worktree and branch (best-effort)
|
||||
const project = await requireProjectRepository(ctx).findById(errand.projectId);
|
||||
if (project) {
|
||||
const clonePath = await resolveClonePath(project, ctx);
|
||||
const worktreeManager = new SimpleGitWorktreeManager(clonePath);
|
||||
try { await worktreeManager.remove(errand.id); } catch { /* no-op if already gone */ }
|
||||
try { await requireBranchManager(ctx).deleteBranch(clonePath, errand.branch); } catch { /* no-op */ }
|
||||
if (errand.projectId) {
|
||||
const project = await requireProjectRepository(ctx).findById(errand.projectId);
|
||||
if (project) {
|
||||
const clonePath = await resolveClonePath(project, ctx);
|
||||
const worktreeManager = new SimpleGitWorktreeManager(clonePath);
|
||||
try { await worktreeManager.remove(errand.id); } catch { /* no-op if already gone */ }
|
||||
try { await requireBranchManager(ctx).deleteBranch(clonePath, errand.branch); } catch { /* no-op */ }
|
||||
}
|
||||
}
|
||||
|
||||
await repo.delete(errand.id);
|
||||
@@ -426,12 +428,14 @@ export function errandProcedures(publicProcedure: ProcedureBuilder) {
|
||||
}
|
||||
|
||||
// Remove worktree and branch (best-effort)
|
||||
const project = await requireProjectRepository(ctx).findById(errand.projectId);
|
||||
if (project) {
|
||||
const clonePath = await resolveClonePath(project, ctx);
|
||||
const worktreeManager = new SimpleGitWorktreeManager(clonePath);
|
||||
try { await worktreeManager.remove(errand.id); } catch { /* no-op if already gone */ }
|
||||
try { await branchManager.deleteBranch(clonePath, errand.branch); } catch { /* no-op */ }
|
||||
if (errand.projectId) {
|
||||
const project = await requireProjectRepository(ctx).findById(errand.projectId);
|
||||
if (project) {
|
||||
const clonePath = await resolveClonePath(project, ctx);
|
||||
const worktreeManager = new SimpleGitWorktreeManager(clonePath);
|
||||
try { await worktreeManager.remove(errand.id); } catch { /* no-op if already gone */ }
|
||||
try { await branchManager.deleteBranch(clonePath, errand.branch); } catch { /* no-op */ }
|
||||
}
|
||||
}
|
||||
|
||||
const updated = await repo.update(input.id, { status: 'abandoned' });
|
||||
|
||||
Reference in New Issue
Block a user