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

14 lines
486 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';
export default (uuid: string, name?: string, ignored?: string): Promise<ServerBackup> => {
return new Promise((resolve, reject) => {
http.post(`/api/client/servers/${uuid}/backups`, {
name, ignored,
})
.then(({ data }) => resolve(rawDataToServerBackup(data)))
.catch(reject);
});
};