26 lines
758 B
TypeScript
26 lines
758 B
TypeScript
import type { ElaprDocPrgrsResponseDto } from "../model/elapr-dmnd-interface";
|
|
|
|
export function hasCurrentUserPendingApprovalRequest(
|
|
list: ElaprDocPrgrsResponseDto[],
|
|
currentUserUuid: string | undefined,
|
|
): boolean {
|
|
if (!currentUserUuid) return false;
|
|
|
|
return list.some(
|
|
(row) =>
|
|
row.aprvrUuid === currentUserUuid && row.atrzPrgrsSttsComCd === "ATRZ_PRGRS_002",
|
|
);
|
|
}
|
|
|
|
export function findCurrentUserPendingApprovalRequest(
|
|
list: ElaprDocPrgrsResponseDto[],
|
|
currentUserUuid: string | undefined,
|
|
): ElaprDocPrgrsResponseDto | undefined {
|
|
if (!currentUserUuid) return undefined;
|
|
|
|
return list.find(
|
|
(row) =>
|
|
row.aprvrUuid === currentUserUuid && row.atrzPrgrsSttsComCd === "ATRZ_PRGRS_002",
|
|
);
|
|
}
|