Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return new Promise((resolve, reject) => {
apigClientFactory.newClient({ invokeUrl: APPCONFIG.AWS.FUNCTIONS.INVOKE_URL })
// .commentsGet({}, {})
.invokeApi({}, "/comments", "GET", {}, {})
.then((response) => {
resolve(this.fixTimestamp(JSON.parse(response.data.body).Items));
})
.catch((error) => {
reject(error);
});
});
}
post(comment) {
const apigClient = apigClientFactory.newClient({
accessKey: AWS.config.credentials.accessKeyId,
secretKey: AWS.config.credentials.secretAccessKey,
sessionToken: AWS.config.credentials.sessionToken,
region: APPCONFIG.AWS.REGION,
invokeUrl: APPCONFIG.AWS.FUNCTIONS.INVOKE_URL
});
return apigClient.invokeApi({}, "/comments", "POST", {}, comment);
}