2020-04-04 17:59:25 +00:00
|
|
|
import http from '@/api/http';
|
2020-08-21 04:44:33 +00:00
|
|
|
import { ServerBackup } from '@/api/server/types';
|
2020-08-22 22:46:13 +00:00
|
|
|
import { rawDataToServerBackup } from '@/api/transformers';
|
2020-04-04 17:59:25 +00:00
|
|
|
|
2021-05-04 04:26:09 +00:00
|
|
|
interface RequestParameters {
|
|
|
|
name?: string;
|
|
|
|
ignored?: string;
|
|
|
|
isLocked: boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
export default async (uuid: string, params: RequestParameters): Promise<ServerBackup> => {
|
|
|
|
const { data } = await http.post(`/api/client/servers/${uuid}/backups`, {
|
|
|
|
name: params.name,
|
|
|
|
ignored: params.ignored,
|
|
|
|
is_locked: params.isLocked,
|
2020-04-04 17:59:25 +00:00
|
|
|
});
|
2021-05-04 04:26:09 +00:00
|
|
|
|
|
|
|
return rawDataToServerBackup(data);
|
2020-04-04 17:59:25 +00:00
|
|
|
};
|