misc_pterodactyl-panel/resources/scripts/api/server/backups/createServerBackup.ts

20 lines
557 B
TypeScript
Raw Normal View History

import http from '@/api/http';
import { ServerBackup } from '@/api/server/types';
2020-08-22 22:46:13 +00:00
import { rawDataToServerBackup } from '@/api/transformers';
interface RequestParameters {
name?: string;
ignored?: string;
isLocked: boolean;
}
export default async (uuid: string, params: RequestParameters): Promise<ServerBackup> => {
const { data } = await http.post(`/api/client/servers/${uuid}/backups`, {
name: params.name,
ignored: params.ignored,
is_locked: params.isLocked,
});
return rawDataToServerBackup(data);
};