server: fix project_shares audit logging and add share transfer
- Fix PATCH /api/projects/:id/shares/:userId: query SELECT 1 instead of SELECT id (project_shares has a composite PK, no id column) - Add audit logging to existing share grant/revoke routes - Add POST /api/projects/:id/transfer for ownership handoff - Remove inline admin user/audit routes from routes.ts (now in admin.ts) - Remove unused requireAdmin import and userPatch schema from routes.ts
This commit is contained in:
@@ -9,6 +9,7 @@ import { openDb, ensureAdmin } from "./db.js";
|
||||
import { hashPassword, registerAuthHook, registerAuthRoutes } from "./auth.js";
|
||||
import { registerRoutes } from "./routes.js";
|
||||
import { registerWs } from "./ws.js";
|
||||
import { registerAdminRoutes } from "./admin.js";
|
||||
|
||||
/** A Fastify error carrying a status code and a serializable payload. */
|
||||
export interface HttpError extends Error {
|
||||
@@ -64,6 +65,7 @@ export async function buildApp() {
|
||||
registerAuthHook(app);
|
||||
registerAuthRoutes(app);
|
||||
registerRoutes(app);
|
||||
registerAdminRoutes(app);
|
||||
registerWs(app);
|
||||
|
||||
return app;
|
||||
|
||||
Reference in New Issue
Block a user