mirror of
https://github.com/Sea-Haven-Industries/shoc-frontend-new.git
synced 2026-10-04 03:13:14 +00:00
12 lines
437 B
TypeScript
12 lines
437 B
TypeScript
|
|
import type { WorkOrderComment } from "@/domain/work-orders/types/work-order-detail";
|
||
|
|
|
||
|
|
export function isOwnWorkOrderComment(
|
||
|
|
comment: WorkOrderComment,
|
||
|
|
currentUserId: string | number | null | undefined,
|
||
|
|
): boolean {
|
||
|
|
if (currentUserId == null || currentUserId === "") return false;
|
||
|
|
const authorId = comment.authorId;
|
||
|
|
if (authorId == null || authorId === "") return false;
|
||
|
|
return String(authorId) === String(currentUserId);
|
||
|
|
}
|