I have a service class with some error types:
public with sharing class ServiceClass {
public enum ErrorType { ERROR }
}
And a controller method:
@AuraEnabled(cacheable=true)
public static ServiceClass getErrorTypes() {
return new ServiceClass();
}
So far, when I load this class in my LWC, the class is an empty object.
When I try to annotate the enum to make it visible:
public with sharing class ServiceClass {
@AuraEnabled
public enum ErrorType { ERROR }
}
I get the error on deployment:
AuraEnabled fields cannot be static
I'm not explicitly making this enum
static. How can I get enum values from a class to an LWC or bypass this error?