Initial attempt trying to get file downloading to work
This commit is contained in:
parent
4e669771ca
commit
8955b5a660
8 changed files with 153 additions and 3 deletions
|
@ -0,0 +1,14 @@
|
|||
import http from "@/api/http";
|
||||
// @ts-ignore
|
||||
import route from '../../../../../../vendor/tightenco/ziggy/src/js/route';
|
||||
|
||||
/**
|
||||
* Gets a download token for a file on the server.
|
||||
*/
|
||||
export function getDownloadToken(server: string, file: string): Promise<string | null> {
|
||||
return new Promise((resolve, reject) => {
|
||||
http.post(route('api.client.servers.files.download', { server, file }))
|
||||
.then(response => resolve(response.data ? response.data.token || null : null))
|
||||
.catch(reject);
|
||||
});
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue