misc_pterodactyl-panel/resources/scripts/api/server/index.ts

15 lines
447 B
TypeScript
Raw Normal View History

2022-02-27 16:40:51 +00:00
import http from '@/api/http';
import { Transformers, Server } from '@definitions/user';
const getServer = async (uuid: string): Promise<[ Server, string[] ]> => {
const { data } = await http.get(`/api/client/servers/${uuid}`);
return [
Transformers.toServer(data),
// eslint-disable-next-line camelcase
data.meta?.is_server_owner ? [ '*' ] : (data.meta?.user_permissions || []),
];
};
export { getServer };