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

12 lines
477 B
TypeScript

import { rawDataToServerBackup, ServerBackup } from '@/api/server/backups/getServerBackups';
import http from '@/api/http';
export default (uuid: string, name?: string, ignore?: string): Promise<ServerBackup> => {
return new Promise((resolve, reject) => {
http.post(`/api/client/servers/${uuid}/backups`, {
name, ignore,
})
.then(({ data }) => resolve(rawDataToServerBackup(data.attributes)))
.catch(reject);
});
};