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