export const getAnalytic = (action: Action) => {
try {
const operations = new Operations();
const analyticsLog = {
action,
total: 1,
};
return (isSuccess: boolean, param: string = '') =>
operations .track({
...analyticsLog,
type: param,
itemsSuccess: Number(isSuccess),
itemsError: Number(!isSuccess),
});
} catch (error) {
return error;
}
};