fix(types): refine user type definitions for assigned users in incident handling
This commit is contained in:
@@ -68,7 +68,7 @@ export const IncidentBasicFields: React.FC = () => {
|
|||||||
const selectedUser = users.find(user => user.id === form.getValues('assigned_to'));
|
const selectedUser = users.find(user => user.id === form.getValues('assigned_to'));
|
||||||
|
|
||||||
// Function to get user initials from name
|
// Function to get user initials from name
|
||||||
const getUserInitials = (user: any): string => {
|
const getUserInitials = (user: { full_name?: string; username: string }): string => {
|
||||||
if (user.full_name) {
|
if (user.full_name) {
|
||||||
const nameParts = user.full_name.split(' ');
|
const nameParts = user.full_name.split(' ');
|
||||||
if (nameParts.length > 1) {
|
if (nameParts.length > 1) {
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ export const generatePdf = async (incident: IncidentItem): Promise<string> => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Fetch assigned user data if available
|
// Fetch assigned user data if available
|
||||||
let assignedUser = null;
|
let assignedUser: { full_name?: string; username?: string } | null = null;
|
||||||
const assigneeId = incident?.assigned_users || incident?.assigned_to;
|
const assigneeId = incident?.assigned_users || incident?.assigned_to;
|
||||||
if (assigneeId) {
|
if (assigneeId) {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -146,7 +146,7 @@ export const addResolutionSection = (doc: jsPDF, incident: IncidentItem, yPos: n
|
|||||||
/**
|
/**
|
||||||
* Add the assignment information section to the PDF
|
* Add the assignment information section to the PDF
|
||||||
*/
|
*/
|
||||||
export const addAssignmentSection = (doc: jsPDF, incident: IncidentItem, yPos: number, assignedUser?: any): number => {
|
export const addAssignmentSection = (doc: jsPDF, incident: IncidentItem, yPos: number, assignedUser?: { full_name?: string; username?: string } | null): number => {
|
||||||
doc.setFontSize(14);
|
doc.setFontSize(14);
|
||||||
doc.setTextColor(30, 64, 175); // Blue-800
|
doc.setTextColor(30, 64, 175); // Blue-800
|
||||||
doc.text('Assignment Information', 15, yPos);
|
doc.text('Assignment Information', 15, yPos);
|
||||||
|
|||||||
Reference in New Issue
Block a user