function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
chandu kari 8chandu kari 8 

hii, i am getting problem,i want to display approval history details in data table using LWC

public with sharing class Approvalhistory {
    
    
    @AuraEnabled(cacheable=true)  
    public static list<ProcessInstanceHistory> getApprovalData(string recordId)  {
        list<ProcessInstanceHistory>history=new list<ProcessInstanceHistory>();
        
        for(ProcessInstance processInstance: getAllhistory(recordId).values())  
        {                  
            for(ProcessInstanceHistory sWI:processInstance.StepsAndWorkitems)  
            {
                system.debug('stepStatus :: '+sWI.StepStatus);
                system.debug('stepName :: '+sWI.Actor.Name);
                history.add(sWI);
            }
        }
        return history;
    }
    
    
    @AuraEnabled
    public static Map<Id,ProcessInstance> getAllhistory(Id recordId)  {  
        return new Map<Id,ProcessInstance>([SELECT Id,Status,SubmittedById, 
                                            (SELECT Id, ProcessNodeId,StepStatus, Comments, TargetObjectId,ActorId,CreatedById,IsDeleted,
                                             IsPending,OriginalActorId,ProcessInstanceId,RemindersSent,CreatedDate, Actor.Name,  
                                             OriginalActor.Name , ProcessNode.Name 
                                             FROM StepsAndWorkitems ORDER BY CreatedDate DESC )
                                            FROM ProcessInstance 
                                            WHERE TargetObjectId =: recordId ORDER BY CreatedDate DESC ]);  
    }  
    

This is my code ,
please help me