Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Network request wrapper to avoid duplicating request params and headers #46

Closed
ccrowley96 opened this issue Mar 31, 2021 · 0 comments · Fixed by #52 or #55
Closed

Network request wrapper to avoid duplicating request params and headers #46

ccrowley96 opened this issue Mar 31, 2021 · 0 comments · Fixed by #52 or #55
Assignees
Labels
refactor 🔨 Code refactoring

Comments

@ccrowley96
Copy link
Contributor

The code below is duplicated in multiple places. @jl-g suggested refactoring the network requests to reduce code duplication.

const axiosData = await axios({
    method: 'get',
    url: this.adtProxyServerURL,
    headers: {
        'Content-Type': 'application/json',
        authorization: 'Bearer ' + token,
        'x-adt-host': this.adtHostUrl,
        'x-adt-endpoint': 'models'
    },
    params: {
        'api-version': '2020-10-31'
    }
});
@ccrowley96 ccrowley96 added the refactor 🔨 Code refactoring label Mar 31, 2021
@ccrowley96 ccrowley96 added this to To do in Cardboard kanban via automation Mar 31, 2021
@iremgokce iremgokce self-assigned this Apr 12, 2021
Cardboard kanban automation moved this from To do to Done Jun 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment