File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -237,7 +237,6 @@ class HawkAPI {
237237 id : userId ,
238238 accessTokenExpired : isAccessTokenExpired ,
239239 } ,
240- eventsFactoryCache : new Map ( ) ,
241240 // accounting,
242241 } ;
243242 }
Original file line number Diff line number Diff line change @@ -12,7 +12,11 @@ const EventsFactory = require('../../models/eventsFactory');
1212 * @returns {EventsFactory } - EventsFactory instance bound to a specific project object
1313 */
1414export function getEventsFactory ( context : ResolverContextBase , projectId : string ) {
15- const cache = context && context . eventsFactoryCache ;
15+ if ( ! context . eventsFactoryCache ) {
16+ context . eventsFactoryCache = new Map ( ) ;
17+ }
18+
19+ const cache = context . eventsFactoryCache ;
1620
1721 if ( cache ) {
1822 if ( ! cache . has ( projectId ) ) {
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ export interface ResolverContextBase {
2424 * Request-scoped cache for EventsFactory instances keyed by projectId
2525 */
2626 // eslint-disable-next-line @typescript-eslint/no-explicit-any
27- eventsFactoryCache : Map < string , any > ;
27+ eventsFactoryCache ? : Map < string , any > ;
2828
2929 // /**
3030 // * SDK for working with CodeX Accounting API
You can’t perform that action at this time.
0 commit comments