File tree 3 files changed +18
-6
lines changed
3 files changed +18
-6
lines changed Original file line number Diff line number Diff line change 28
28
- attach_workspace :
29
29
at : .
30
30
- run : echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
31
- - run : npm publish
31
+ - run : npm publish --tag test-release
32
32
# dont change anything
33
33
workflows :
34
34
version : 2
Original file line number Diff line number Diff line change 31
31
"lint:js" : " ./node_modules/.bin/eslint --ext .js,.jsx ." ,
32
32
"test" : " npm run lint && npm run jest"
33
33
},
34
- "version" : " 1.0.5 " ,
34
+ "version" : " 1000.22.10 " ,
35
35
"dependencies" : {
36
36
"auth0-js" : " ^6.8.4" ,
37
37
"config" : " ^3.2.0" ,
Original file line number Diff line number Diff line change @@ -95,10 +95,22 @@ class TermsService {
95
95
* @param {Number|String } termId id of the term
96
96
* @return {Promise } promise of the request result
97
97
*/
98
- getTermDetails ( termId ) {
99
- // looks like server cache responses, to prevent it we add nocache param with always new value
100
- return this . private . api . get ( `/terms/${ termId } ` )
101
- . then ( res => ( res . ok ? res . json ( ) : Promise . reject ( res . json ( ) ) ) ) ;
98
+ async getTermDetails ( termId ) {
99
+ let termDetails = { } ;
100
+ let isLegacyTerm = false ;
101
+ if ( / ^ [ \d ] { 5 , 8 } $ / . test ( termId ) ) {
102
+ isLegacyTerm = true ;
103
+ termDetails = await this . private . api . get ( `/terms?legacyId=${ termId } ` )
104
+ . then ( res => ( res . ok ? res . json ( ) : Promise . reject ( res . json ( ) ) ) )
105
+ . then ( res => ( res . result ? res . result [ 0 ] : Promise . reject ( res . json ( ) ) ) ) ;
106
+ } else {
107
+ termDetails = await this . private . api . get ( `/terms/${ termId } ` )
108
+ . then ( res => ( res . ok ? res . json ( ) : Promise . reject ( res . json ( ) ) ) ) ;
109
+ }
110
+ return {
111
+ ...termDetails ,
112
+ isLegacyTerm,
113
+ } ;
102
114
}
103
115
104
116
/**
You can’t perform that action at this time.
0 commit comments