chore: refactor url creation

This commit is contained in:
Ramires Viana committed 2022-05-02 13:47:22 +00:00
1 parent f663237a16
commit 9734f707f0
12 files changed
+106 -69

No files matched your search

+5 -1
View File
@@ -1,4 +1,4 @@
import { fetchURL, fetchJSON, removePrefix } from "./utils";
import { fetchURL, fetchJSON, removePrefix, createURL } from "./utils";
export async function list() {
return fetchJSON("/api/shares");
@@ -34,3 +34,7 @@ export async function create(url, password = "", expires = "", unit = "hours") {
body: body,
});
}
export function getShareURL(share) {
return createURL("share/" + share.hash, {}, false);
}