Very basic implemention of frontend logic required to display backups and create a new one

This commit is contained in:
Dane Everitt 2020-04-04 10:59:25 -07:00
parent 17ec4efd3b
commit 9991989f89
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
16 changed files with 431 additions and 2 deletions

View file

@ -0,0 +1,12 @@
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);
});
};