diff --git a/src/webparts/ctFormsPortal/forms/oid/components/Step4Approval/useStep4Approval.ts b/src/webparts/ctFormsPortal/forms/oid/components/Step4Approval/useStep4Approval.ts index 7dac6c7..c80bbbd 100644 --- a/src/webparts/ctFormsPortal/forms/oid/components/Step4Approval/useStep4Approval.ts +++ b/src/webparts/ctFormsPortal/forms/oid/components/Step4Approval/useStep4Approval.ts @@ -223,9 +223,9 @@ export function useStep4Approval(args: UseStep4ApprovalArgs) { comment.trim() ); - const notify = async (spId: number, statusForFlow: string): Promise => { + const notify = async (spId: number): Promise => { try { - await service.triggerApprovalNotification(spId, statusForFlow); + await service.triggerApprovalNotification(spId); } catch (e) { console.error("[Step4] notify failed for spId", spId, e); setNotifyWarning( @@ -262,17 +262,17 @@ export function useStep4Approval(args: UseStep4ApprovalArgs) { await service.updateOIDStatus(oid!.id, "approved"); onSave({ oid: { ...oid!, status: "approved" }, approvalChain: updatedChain }); if (currentMember.spApprovalId) { - await notify(currentMember.spApprovalId, "Согласовано"); + await notify(currentMember.spApprovalId); } onStepComplete(4); } else { const nextPending = updatedChain.find((m) => m.status === "pending"); if (nextPending) { if (currentMember.spApprovalId) { - await notify(currentMember.spApprovalId, "На согласовании"); + await notify(currentMember.spApprovalId); } if (nextPending.spApprovalId) { - await notify(nextPending.spApprovalId, "На согласовании"); + await notify(nextPending.spApprovalId); } } } @@ -305,7 +305,7 @@ export function useStep4Approval(args: UseStep4ApprovalArgs) { oid: { ...oid!, status: "rejected" }, }); const initiator = finalChain.find((m) => m.role === "Инициатор"); - if (initiator?.spApprovalId) await notify(initiator.spApprovalId, "Отклонено"); + if (initiator?.spApprovalId) await notify(initiator.spApprovalId); } closeActionDialog(); @@ -350,7 +350,7 @@ export function useStep4Approval(args: UseStep4ApprovalArgs) { ); if (firstApprover?.spApprovalId) { try { - await service.triggerApprovalNotification(firstApprover.spApprovalId, "На согласовании"); + await service.triggerApprovalNotification(firstApprover.spApprovalId); } catch (e) { console.error("[Step4] notify (send) failed", e); setNotifyWarning( diff --git a/src/webparts/ctFormsPortal/forms/oid/services/OidService.ts b/src/webparts/ctFormsPortal/forms/oid/services/OidService.ts index 34b277e..b3e868a 100644 --- a/src/webparts/ctFormsPortal/forms/oid/services/OidService.ts +++ b/src/webparts/ctFormsPortal/forms/oid/services/OidService.ts @@ -1250,17 +1250,14 @@ export class OidService { ); } - // status — финальный статус СТ («Согласовано»/«На согласовании»/«Отклонено»), который поток - // использует для выбора ветки. Передаём явно, чтобы поток НЕ перечитывал статус из SharePoint - // (коннектор может вернуть устаревшее значение сразу после записи — read-after-write lag). - async triggerApprovalNotification(spItemId: number, status?: string): Promise { + async triggerApprovalNotification(spItemId: number): Promise { if (!FLOW_NOTIFY) return; const client = await this.context.aadHttpClientFactory.getClient( "https://service.flow.microsoft.com/", ); const res = await client.post(FLOW_NOTIFY, AadHttpClient.configurations.v1, { headers: { "Content-Type": "application/json" }, - body: JSON.stringify({ RowID: spItemId, status: status ?? "" }), + body: JSON.stringify({ RowID: spItemId }), }); if (!res.ok) { const text = await res.text().catch(() => "");