Chore: Migrate REST API - getServerInfo to Typescript (#3900)
This commit is contained in:
parent
ee336a84a3
commit
07094aabe6
|
@ -379,7 +379,7 @@ async function getServerInfo(server: string) {
|
|||
const response = await RNFetchBlob.fetch('GET', `${server}/api/info`, { ...RocketChatSettings.customHeaders });
|
||||
try {
|
||||
// Try to resolve as json
|
||||
const jsonRes = response.json();
|
||||
const jsonRes: { version?: string; success: boolean } = response.json();
|
||||
if (!jsonRes?.success) {
|
||||
return {
|
||||
success: false,
|
||||
|
|
|
@ -18,7 +18,7 @@ const methods = {
|
|||
};
|
||||
|
||||
export const compareServerVersion = (
|
||||
currentServerVersion: string | null,
|
||||
currentServerVersion: string | null | undefined,
|
||||
method: keyof typeof methods,
|
||||
versionToCompare: string
|
||||
): boolean =>
|
||||
|
|
Loading…
Reference in New Issue