146146
147147<script lang="ts">
148148import axios from ' axios'
149+ // eslint-disable-next-line sort-imports
149150import { byError , emailQueries , orcidQueries } from ' src/error-filtering'
150151import { computed , defineComponent } from ' vue'
151152import InfoDialog from ' components/InfoDialog.vue'
@@ -209,18 +210,19 @@ export default defineComponent({
209210 }
210211 },
211212 watch: {
212- orcid(oldVal , newVal ) {
213+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
214+ orcid (oldVal , newVal ) {
213215 if (this .orcid .length === 37 && this .orcidErrors .length === 0 ) {
214216 // 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'
217219 // This is a test endpoint on Zenodo sandbox.
218220 // const orcidEndpoint = 'https://pub.sandbox.orcid.org/v3.0/expanded-search/?q=orcid:0000-0001-8555-849X&rows=1';
219221
220222 axios .interceptors .request .use ((config ) => {
221- config .props = this ;
222- return config ;
223- });
223+ config .props = this
224+ return config
225+ })
224226
225227 void axios .get (orcidEndpoint ,
226228 {
@@ -229,10 +231,14 @@ export default defineComponent({
229231 accept: ' application/vnd.orcid+json'
230232 }
231233 }).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 ])
236242 })
237243 }
238244 }
0 commit comments