File tree Expand file tree Collapse file tree 5 files changed +5
-9
lines changed Expand file tree Collapse file tree 5 files changed +5
-9
lines changed Original file line number Diff line number Diff line change 1
- import { get } from '@ember/object' ;
2
1
import { service } from '@ember/service' ;
3
2
import Base from 'ember-simple-auth/authenticators/base' ;
4
3
import jwtDecode from 'ilios-common/utils/jwt-decode' ;
@@ -28,8 +27,7 @@ export default class IliosJWT extends Base {
28
27
29
28
async restore ( data ) {
30
29
const now = DateTime . now ( ) . toUnixInteger ( ) ;
31
- const jwt = get ( data , 'jwt' ) ;
32
- let exp = get ( data , 'exp' ) ;
30
+ let { jwt, exp } = data ;
33
31
34
32
if ( ! exp ) {
35
33
// Fetch the expiration time from the token data since `exp` wasn't included in the data object that was passed in.
Original file line number Diff line number Diff line change 1
1
import IliosSerializer from './ilios' ;
2
- import { get } from '@ember/object' ;
3
2
4
3
export default class LearningMaterialSerializer extends IliosSerializer {
5
4
serialize ( snapshot , options ) {
6
5
const json = super . serialize ( snapshot , options ) ;
7
6
//When POSTing new file learningMaterials we need to include the file hash
8
- const fileHash = get ( snapshot . record , ' fileHash' ) ;
7
+ const fileHash = snapshot . record ?. fileHash ;
9
8
if ( fileHash ) {
10
9
json . data . attributes . fileHash = fileHash ;
11
10
}
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ export default class CurrentUserService extends Service {
21
21
}
22
22
const obj = jwtDecode ( this . session . data . authenticated . jwt ) ;
23
23
24
- return get ( obj , ' user_id' ) ;
24
+ return obj ?. user_id ;
25
25
}
26
26
27
27
async getModel ( ) {
Original file line number Diff line number Diff line change 1
1
// taken from Ember Composable Helpers (https://github.com/DockYard/ember-composable-helpers), then modified.
2
- import EmberObject , { get } from '@ember/object' ;
2
+ import EmberObject from '@ember/object' ;
3
3
4
4
function isIterable ( value ) {
5
5
return Symbol . iterator in Object ( value ) ;
@@ -55,7 +55,7 @@ function _asArray(maybeArray) {
55
55
}
56
56
if ( typeof maybeArray === 'object' ) {
57
57
if ( isPromiseProxyLike ( maybeArray ) ) {
58
- const content = get ( maybeArray , 'content' ) ;
58
+ const { content } = maybeArray ;
59
59
if ( typeof content !== 'object' || content === null ) {
60
60
throw new Error ( 'Unknown content type in array-like object [ilios-common]' ) ;
61
61
}
Original file line number Diff line number Diff line change @@ -51,7 +51,6 @@ export default [
51
51
reportUnusedDisableDirectives : 'error' ,
52
52
} ,
53
53
rules : {
54
- 'ember/no-get' : 'off' ,
55
54
'no-duplicate-imports' : 'error' ,
56
55
} ,
57
56
} ,
You can’t perform that action at this time.
0 commit comments