Merge pull request #2007 from influxdata/fix/authorizations-response

Match shape of get/authorizations to backend response
pull/10616/head
Alirie Gray 2018-12-18 10:06:28 -08:00 committed by GitHub
commit d9e9b1fd85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 5 additions and 5 deletions

View File

@ -3666,7 +3666,7 @@ components:
links:
readOnly: true
$ref: "#/components/schemas/Links"
auths:
authorizations:
type: array
items:
$ref: "#/components/schemas/Authorization"

View File

@ -417,7 +417,7 @@ export const createTelegrafConfigResponse = {
export const authResponse = {
data: {
links: {self: '/api/v2/authorizations'},
auths: [
authorizations: [
{
links: {
self: '/api/v2/authorizations/030358b6aa718000',

View File

@ -171,7 +171,7 @@ export interface Authorizations {
* @type {Array<Authorization>}
* @memberof Authorizations
*/
auths?: Array<Authorization>;
authorizations?: Array<Authorization>;
/**
*
* @type {Links}

View File

@ -4,7 +4,7 @@ import {AxiosResponse} from 'axios'
export const getAuthorizations = async (): Promise<Authorization[]> => {
const {data} = await authorizationsAPI.authorizationsGet()
return data.auths
return data.authorizations
}
export const deleteAuthorization = async (

View File

@ -93,7 +93,7 @@ export const getAuthorizationToken = async (
): Promise<string> => {
try {
const data = await authorizationsAPI.authorizationsGet(undefined, username)
return getDeep<string>(data, 'data.auths.0.token', '')
return getDeep<string>(data, 'data.authorizations.0.token', '')
} catch (error) {
console.error(error)
}