add workflow
This commit is contained in:
parent
4a933c79cd
commit
f3eadd867a
1 changed files with 15 additions and 1 deletions
|
|
@ -25,6 +25,7 @@ import { DevelopmentProject } from "../entities/DevelopmentProject";
|
|||
import { ProfileDevelopment } from "../entities/ProfileDevelopment";
|
||||
import { ProfileDevelopmentHistory } from "../entities/ProfileDevelopmentHistory";
|
||||
import { setLogDataDiff } from "../interfaces/utils";
|
||||
import CallAPI from "../interfaces/call-api";
|
||||
@Route("api/v1/org/profile/development-request")
|
||||
@Tags("DevelopmentRequest")
|
||||
@Security("bearerAuth")
|
||||
|
|
@ -207,7 +208,10 @@ export class DevelopmentRequestController extends Controller {
|
|||
@Request() req: RequestWithUser,
|
||||
@Body() body: CreateDevelopmentRequest,
|
||||
) {
|
||||
const profile = await this.profileRepository.findOneBy({ keycloak: req.user.sub });
|
||||
const profile = await this.profileRepository.findOne({
|
||||
where: { keycloak: req.user.sub },
|
||||
relations: ["posLevel", "posType"],
|
||||
});
|
||||
if (!profile) {
|
||||
throw new HttpError(HttpStatus.BAD_REQUEST, "ไม่พบ profile ดังกล่าว");
|
||||
}
|
||||
|
|
@ -246,6 +250,16 @@ export class DevelopmentRequestController extends Controller {
|
|||
}),
|
||||
);
|
||||
}
|
||||
await new CallAPI()
|
||||
.PostData(req, "/org/workflow/add-workflow", {
|
||||
refId: data.id,
|
||||
sysName: "REGISTRY_IDP",
|
||||
posLevelName: profile.posLevel.posLevelName,
|
||||
posTypeName: profile.posType.posTypeName,
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error("Error calling API:", error);
|
||||
});
|
||||
return new HttpSuccess(data.id);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue