misc_pterodactyl-panel/resources/scripts/api/server/index.ts
2022-02-27 11:40:51 -05:00

14 lines
447 B
TypeScript

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 };