2020-04-04 17:59:25 +00:00
|
|
|
import { rawDataToServerBackup, ServerBackup } from '@/api/server/backups/getServerBackups';
|
|
|
|
import http from '@/api/http';
|
|
|
|
|
2020-04-19 06:26:59 +00:00
|
|
|
export default (uuid: string, name?: string, ignored?: string): Promise<ServerBackup> => {
|
2020-04-04 17:59:25 +00:00
|
|
|
return new Promise((resolve, reject) => {
|
|
|
|
http.post(`/api/client/servers/${uuid}/backups`, {
|
2020-04-19 06:26:59 +00:00
|
|
|
name, ignored,
|
2020-04-04 17:59:25 +00:00
|
|
|
})
|
2020-04-04 19:26:39 +00:00
|
|
|
.then(({ data }) => resolve(rawDataToServerBackup(data)))
|
2020-04-04 17:59:25 +00:00
|
|
|
.catch(reject);
|
|
|
|
});
|
|
|
|
};
|