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 });
|
const response = await RNFetchBlob.fetch('GET', `${server}/api/info`, { ...RocketChatSettings.customHeaders });
|
||||||
try {
|
try {
|
||||||
// Try to resolve as json
|
// Try to resolve as json
|
||||||
const jsonRes = response.json();
|
const jsonRes: { version?: string; success: boolean } = response.json();
|
||||||
if (!jsonRes?.success) {
|
if (!jsonRes?.success) {
|
||||||
return {
|
return {
|
||||||
success: false,
|
success: false,
|
||||||
|
|
|
@ -18,7 +18,7 @@ const methods = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const compareServerVersion = (
|
export const compareServerVersion = (
|
||||||
currentServerVersion: string | null,
|
currentServerVersion: string | null | undefined,
|
||||||
method: keyof typeof methods,
|
method: keyof typeof methods,
|
||||||
versionToCompare: string
|
versionToCompare: string
|
||||||
): boolean =>
|
): boolean =>
|
||||||
|
|
Loading…
Reference in New Issue