mirror of
https://github.com/Sea-Haven-Industries/shoc-frontend-new.git
synced 2026-10-01 10:53:11 +00:00
11 lines
437 B
TypeScript
11 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);
|
|
}
|