I get this error message. Not sure why. Im not missing any semicolons
Error : Parse error. 'identifier' expected newLeadClick : function(component, event, helper) {
newLeadClick : function(component, event, helper) {
const workspaceAPI = component.find("workspace");
workspaceAPI.getEnclosingTabId().then(function(tabId) {
const tabContext = {
parentTabId: tabId,
url: '/lightning/r/Lead/'+component.get("v.LeadId")+'/view',
focus: true
}
helper.openWorkspaceSubTab(component, workspaceAPI, tabContext);
});
},
/**
*This function is responsible for opening the opportunity page in subtab in readmode on click of Open Opportunity Button
*/
newOppClick : function(component, event, helper) {
const workspaceAPI = component.find("workspace");
workspaceAPI.getEnclosingTabId().then(function(tabId) {
const tabContext = {
parentTabId: tabId,
url: '/lightning/r/Opportunity/'+component.get("v.OppId")+'/view',
focus: true
}
helper.openWorkspaceSubTab(component, workspaceAPI, tabContext);
});
},