master
Matthew 2021-12-09 21:35:31 -05:00
parent 8208566ebb
commit 3f120add64
No known key found for this signature in database
GPG Key ID: 210AF32ADE3B5C4B
1 changed files with 2 additions and 15 deletions

View File

@ -38,21 +38,8 @@ export default class CloudServicesUtil {
} }
static async setTier(userID: string, tier: 1 | 2 | 3, authorization: string) { static async setTier(userID: string, tier: 1 | 2 | 3, authorization: string) {
let responseStatus: number; const response = await axios.get(`https://api.cloud.libraryofcode.org/wh/set-tier?userID=${userID}&t=${tier}&auth=${authorization}`);
switch (tier) { return response.status;
case 1:
responseStatus = (await axios.get(`https://api.cloud.libraryofcode.org/wh/t2-rm?userID=${userID}&auth=${authorization}`)).status;
break;
case 2:
responseStatus = (await axios.get(`https://api.cloud.libraryofcode.org/wh/t2?userID=${userID}&auth=${authorization}`)).status;
break;
case 3:
responseStatus = (await axios.get(`https://api.cloud.libraryofcode.org/wh/t3?userID=${userID}&auth=${authorization}`)).status;
break;
default:
throw new RangeError('Invalid Tier.');
}
return responseStatus;
} }
static async fetchAccountStatus(userID: string, authorization: string) { static async fetchAccountStatus(userID: string, authorization: string) {