diff --git a/pkg/services/serviceaccounts/models.go b/pkg/services/serviceaccounts/models.go index 1be9b033908..876817b23a8 100644 --- a/pkg/services/serviceaccounts/models.go +++ b/pkg/services/serviceaccounts/models.go @@ -38,11 +38,11 @@ var ( ) type MigrationResult struct { - Total int - Migrated int - Failed int - FailedApikeyIDs []int64 - FailedDetails []string + Total int `json:"total"` + Migrated int `json:"migrated"` + Failed int `json:"failed"` + FailedApikeyIDs []int64 `json:"failedApikeyIDs"` + FailedDetails []string `json:"failedDetails"` } type ServiceAccount struct { diff --git a/public/app/features/api-keys/state/actions.ts b/public/app/features/api-keys/state/actions.ts index 73a9165221f..f81a8310d48 100644 --- a/public/app/features/api-keys/state/actions.ts +++ b/public/app/features/api-keys/state/actions.ts @@ -36,7 +36,7 @@ export function migrateAll(): ThunkResult { return async (dispatch) => { try { const payload = await getBackendSrv().post('/api/serviceaccounts/migrate'); - dispatch(setMigrationResult({ payload })); + dispatch(setMigrationResult(payload)); } finally { dispatch(loadApiKeys()); } diff --git a/public/app/features/api-keys/state/reducers.ts b/public/app/features/api-keys/state/reducers.ts index 075388f9c31..6e5ad5d277e 100644 --- a/public/app/features/api-keys/state/reducers.ts +++ b/public/app/features/api-keys/state/reducers.ts @@ -39,8 +39,7 @@ const apiKeysSlice = createSlice({ return { ...state, hasFetched: false }; }, setMigrationResult: (state, action): ApiKeysState => { - const { migrationResult } = action.payload; - return { ...state, migrationResult: migrationResult }; + return { ...state, migrationResult: action.payload }; }, }, });