146
146
147
147
<script lang="ts">
148
148
import axios from ' axios'
149
+ // eslint-disable-next-line sort-imports
149
150
import { byError , emailQueries , orcidQueries } from ' src/error-filtering'
150
151
import { computed , defineComponent } from ' vue'
151
152
import InfoDialog from ' components/InfoDialog.vue'
@@ -209,18 +210,19 @@ export default defineComponent({
209
210
}
210
211
},
211
212
watch: {
212
- orcid(oldVal , newVal ) {
213
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
214
+ orcid (oldVal , newVal ) {
213
215
if (this .orcid .length === 37 && this .orcidErrors .length === 0 ) {
214
216
// If a valid orcid is found, look for data in the orcid API (maybe only if we do not have data already)
215
- const orcidSearchApi = ' https://pub.orcid.org/v3.0/expanded-search/?q=orcid:' ;
216
- const orcidEndpoint = this .orcid .replace (' https://orcid.org/' , orcidSearchApi ) + ' &rows=1' ;
217
+ const orcidSearchApi = ' https://pub.orcid.org/v3.0/expanded-search/?q=orcid:'
218
+ const orcidEndpoint = this .orcid .replace (' https://orcid.org/' , orcidSearchApi ) + ' &rows=1'
217
219
// This is a test endpoint on Zenodo sandbox.
218
220
// const orcidEndpoint = 'https://pub.sandbox.orcid.org/v3.0/expanded-search/?q=orcid:0000-0001-8555-849X&rows=1';
219
221
220
222
axios .interceptors .request .use ((config ) => {
221
- config .props = this ;
222
- return config ;
223
- });
223
+ config .props = this
224
+ return config
225
+ })
224
226
225
227
void axios .get (orcidEndpoint ,
226
228
{
@@ -229,10 +231,14 @@ export default defineComponent({
229
231
accept: ' application/vnd.orcid+json'
230
232
}
231
233
}).then (resp => {
232
- resp .config .props .$emit (' update' , ' givenNames' , resp .data [' expanded-result' ][0 ][' given-names' ]);
233
- resp .config .props .$emit (' update' , ' familyNames' , resp .data [' expanded-result' ][0 ][' family-names' ]);
234
- resp .config .props .$emit (' update' , ' email' , resp .data [' expanded-result' ][0 ].email [0 ]);
235
- resp .config .props .$emit (' update' , ' affiliation' , resp .data [' expanded-result' ][0 ][' institution-name' ][0 ]);
234
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
235
+ resp .config .props .$emit (' update' , ' givenNames' , resp .data [' expanded-result' ][0 ][' given-names' ])
236
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
237
+ resp .config .props .$emit (' update' , ' familyNames' , resp .data [' expanded-result' ][0 ][' family-names' ])
238
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
239
+ resp .config .props .$emit (' update' , ' email' , resp .data [' expanded-result' ][0 ].email [0 ])
240
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
241
+ resp .config .props .$emit (' update' , ' affiliation' , resp .data [' expanded-result' ][0 ][' institution-name' ][0 ])
236
242
})
237
243
}
238
244
}
0 commit comments