mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-14 01:50:39 +09:00
feat(openclaw): add adapter hire-approved hooks
This commit is contained in:
parent
67bc601258
commit
3369a9e685
12 changed files with 512 additions and 3 deletions
|
|
@ -24,7 +24,7 @@ import {
|
|||
import type { DeploymentExposure, DeploymentMode } from "@paperclipai/shared";
|
||||
import { forbidden, conflict, notFound, unauthorized, badRequest } from "../errors.js";
|
||||
import { validate } from "../middleware/validate.js";
|
||||
import { accessService, agentService, logActivity } from "../services/index.js";
|
||||
import { accessService, agentService, logActivity, notifyHireApproved } from "../services/index.js";
|
||||
import { assertCompanyAccess } from "./authz.js";
|
||||
import { claimBoardOwnership, inspectBoardClaimChallenge } from "../board-claim.js";
|
||||
|
||||
|
|
@ -1365,6 +1365,16 @@ export function accessRoutes(
|
|||
details: { requestType: existing.requestType, createdAgentId },
|
||||
});
|
||||
|
||||
if (createdAgentId) {
|
||||
void notifyHireApproved(db, {
|
||||
companyId,
|
||||
agentId: createdAgentId,
|
||||
source: "join_request",
|
||||
sourceId: requestId,
|
||||
approvedAt: new Date(),
|
||||
}).catch(() => {});
|
||||
}
|
||||
|
||||
res.json(toJoinRequestResponse(approved));
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue