Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Syntax error Invalid Regular expression angular typescript

i am getting this error and i am stuck cant find where is the syntax problem

core.mjs:6495 ERROR SyntaxError: Invalid regular expression:
/https://graph.microsoft.com/v1.0/communications/callRecords/getPstnCalls(fromDateTime=2020-01-30,toDateTime=2020-01-30/:
Unterminated group
at new RegExp ()
at Function.StringUtils.matchPattern (StringUtils.js:122)
at azure-msal-angular.js:425
at Array.forEach ()
at MsalInterceptor.matchResourcesToEndpoint (azure-msal-angular.js:422)
at MsalInterceptor.getScopesForEndpoint (azure-msal-angular.js:404)
at MsalInterceptor.intercept (azure-msal-angular.js:336)
at HttpInterceptorHandler.handle (http.mjs:1415)
at HttpXsrfInterceptor.intercept (http.mjs:2018)
at HttpInterceptorHandler.handle (http.mjs:1415)

export function MSALInterceptorConfigFactory(): MsalInterceptorConfiguration {
  
 var fromDatetimeVariable ='2020-01-30';
 var toDatetimeVariable='2020-01-30';

  let queryUrl = `https://graph.microsoft.com/v1.0/communications/callRecords/getPstnCalls(fromDateTime=${fromDatetimeVariable},toDateTime=${toDatetimeVariable}`

  const protectedResourceMap = new Map<string, Array<string>>();
  protectedResourceMap.set(queryUrl, ['CallRecords.Read.All', 'CallRecord-PstnCalls.Read.All']);
  
 // protectedResourceMap.set('https://graph.microsoft.com/v1.0/me', ['CallRecord-PstnCalls.Read.All', 'mail.read']);
 // protectedResourceMap.set('http://localhost:8080/hello', ['api://d16e1a06-3be2-4ae1-8bd4-718c19cecac3/hello']);

  return {
    interactionType: InteractionType.Popup,
    protectedResourceMap
  };
}

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You have missed to close the parentheses in the queryUrl value. To correct this, your queryUrl value must be like:

let queryUrl = `https://graph.microsoft.com/v1.0/communications/callRecords/getPstnCalls(fromDateTime=${fromDatetimeVariable},toDateTime=${toDatetimeVariable})`
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading