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

13 lines
466 B
TypeScript
Raw Normal View History

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)))
.catch(reject);
});
};