Created
November 20, 2020 09:00
-
-
Save albarivas/3d33e6894c72d76b795cdfe694a70e94 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public with sharing class DataloadSwitchController { | |
@AuraEnabled | |
public static String toogleValidationRule(String validationRuleId, Boolean state){ | |
System.debug('Toggle apex method called'); | |
System.debug('validationRuleId: '+ validationRuleId); | |
System.debug('state: ' + state); | |
HttpResponse resp = new HttpResponse(); | |
resp.setStatusCode(204); | |
resp.setBody('empty body'); | |
return serializeHttpResponse(resp); | |
} | |
private static String serializeHttpResponse(HttpResponse httpResponse) | |
{ | |
Parameters parameters = new Parameters(); | |
parameters.add('body', httpResponse.getBody()); | |
parameters.add('status', httpResponse.getStatus()); | |
parameters.add('statusCode', String.valueOf(httpResponse.getStatusCode())); | |
return parameters.serialize(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment