add functionality and refactor the code
This commit is contained in:
22
app/components/Pterodactyl/helpers.tsx
Normal file
22
app/components/Pterodactyl/helpers.tsx
Normal file
@@ -0,0 +1,22 @@
|
||||
export default function helpers(pterodactyl: any) {
|
||||
return {
|
||||
// helper what return auth header
|
||||
async authHeader() {
|
||||
return {
|
||||
Authorization: `Bearer ${pterodactyl.api_key}`,
|
||||
"Content-Type": "application/json",
|
||||
Accept: "Application/vnd.pterodactyl.v1+json",
|
||||
};
|
||||
},
|
||||
|
||||
// setter for api key
|
||||
async setApiKey(apiKey: string) {
|
||||
return (pterodactyl.api_key = apiKey);
|
||||
},
|
||||
|
||||
// setter for server id
|
||||
async setServerID(serverID: string) {
|
||||
return (pterodactyl.server_id = serverID);
|
||||
},
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user