2020-06-13 04:24:00 +02:00
|
|
|
import client from "../client";
|
|
|
|
|
|
|
|
|
|
export default {
|
2024-07-11 22:21:14 +02:00
|
|
|
list: async (latest) => {
|
|
|
|
|
const response = await client.get('/api/saves/list', {
|
|
|
|
|
params: {
|
|
|
|
|
latest
|
|
|
|
|
}
|
|
|
|
|
});
|
2020-06-13 04:24:00 +02:00
|
|
|
return response.data;
|
|
|
|
|
},
|
2020-06-20 23:31:05 +02:00
|
|
|
delete: async (save) => {
|
|
|
|
|
const response = await client.get(`/api/saves/rm/${save.name}`);
|
|
|
|
|
return response.data;
|
|
|
|
|
},
|
|
|
|
|
create: async (name) => {
|
|
|
|
|
const response = await client.get(`/api/saves/create/${name}`);
|
|
|
|
|
return response.data;
|
2020-08-02 20:22:53 +02:00
|
|
|
},
|
2020-10-24 12:25:30 +02:00
|
|
|
upload: async file => {
|
2020-08-02 20:22:53 +02:00
|
|
|
let formData = new FormData();
|
2020-10-24 12:25:30 +02:00
|
|
|
formData.append("savefile", file);
|
2020-08-02 20:22:53 +02:00
|
|
|
|
|
|
|
|
const response = await client.post(`/api/saves/upload`, formData, {
|
|
|
|
|
headers: {
|
|
|
|
|
"Content-Type": "multipart/form-data"
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
return response.data;
|
2020-09-20 20:07:15 +02:00
|
|
|
},
|
|
|
|
|
mods: async save => {
|
|
|
|
|
const response = await client.post("/api/saves/mods", {
|
|
|
|
|
saveFile: save
|
|
|
|
|
});
|
|
|
|
|
return response.data;
|
2020-06-20 23:31:05 +02:00
|
|
|
}
|
2020-06-13 04:24:00 +02:00
|
|
|
}
|