Philipp Fischbeck f794208862
Fix more typing issues (#928)
* Fix or comment several ts-ignores

* Fix typing related to BaseOverflowButton

* Remove unused functionality of useCookbooks, fix usage bug

* Fix more typing, add some comments

* Only allow ts-ignore if it has a comment
2022-01-15 17:38:11 -09:00

24 lines
474 B
TypeScript

import { BaseAPI } from "../_base";
const prefix = "/api";
interface DownloadData {
fileToken: string,
}
export class UtilsAPI extends BaseAPI {
async download(url: string) {
const { response } = await this.requests.get<DownloadData>(url);
if (!response) {
return;
}
const token: string = response.data.fileToken;
const tokenURL = prefix + "/utils/download?token=" + token;
window.open(tokenURL, "_blank");
return response;
}
}