Skip to content

Commit

Permalink
PMM-12912 Update api response
Browse files Browse the repository at this point in the history
  • Loading branch information
matejkubinec committed Jul 4, 2024
1 parent 0875d2c commit 1d92966
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 10 deletions.
16 changes: 11 additions & 5 deletions public/app/percona/shared/core/reducers/updates/updates.types.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
export interface UpdateInformation {
export interface CurrentInformation {
version?: string;
fullVersion?: string;
timestamp?: string;
}

export interface LatestInformation {
version?: string;
tag?: string;
timestamp?: string;
}

export interface UpdatesState {
isLoading: boolean;
updateAvailable?: boolean;
installed?: UpdateInformation;
latest?: UpdateInformation;
installed?: CurrentInformation;
latest?: LatestInformation;
latestNewsUrl?: string;
lastChecked?: string;
}

export interface CheckUpdatesPayload {
installed?: UpdateInformation;
latest?: UpdateInformation;
installed?: CurrentInformation;
latest?: LatestInformation;
latestNewsUrl?: string;
lastChecked?: string;
updateAvailable: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const responseToPayload = (response: CheckUpdatesResponse): CheckUpdatesP
latest: response.latest
? {
version: response.latest.version,
fullVersion: response.latest.full_version,
tag: response.latest.tag,
timestamp: response.latest.timestamp,
}
: undefined,
Expand Down
14 changes: 10 additions & 4 deletions public/app/percona/shared/services/updates/Updates.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,21 @@ export interface CheckUpdatesBody {
only_installed_version?: boolean;
}

export interface VersionInfo {
export interface CurrentInfo {
version?: string;
full_version?: string;
timestamp: string;
timestamp?: string;
}

export interface LatestInfo {
version?: string;
tag?: string;
timestamp?: string;
}

export interface CheckUpdatesResponse {
installed?: VersionInfo;
latest?: VersionInfo;
installed?: CurrentInfo;
latest?: LatestInfo;
update_available?: boolean;
latest_news_url?: string;
last_check?: string;
Expand Down

0 comments on commit 1d92966

Please sign in to comment.