Fix file and backup downloading to use URL returned by server

This commit is contained in:
Dane Everitt 2020-04-06 20:28:14 -07:00
parent 4b19e65eb8
commit a924eb56cc
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
7 changed files with 198 additions and 59 deletions

View file

@ -0,0 +1,9 @@
import http from '@/api/http';
export default (uuid: string, backup: string): Promise<string> => {
return new Promise((resolve, reject) => {
http.get(`/api/client/servers/${uuid}/backups/${backup}/download`)
.then(({ data }) => resolve(data.attributes.url))
.catch(reject);
});
};