upd: dahsboard admin
Deskripsi: - tampil image - tampil ttd pada setting desa No Issues
This commit is contained in:
@@ -128,11 +128,15 @@ export async function listFiles(config: Config): Promise<{ name: string }[]> {
|
||||
}
|
||||
}
|
||||
|
||||
export async function catFile(config: Config, fileName: string): Promise<string> {
|
||||
const downloadUrlResponse = await fetchWithAuth(config, `${config.URL}/${config.REPO}/file/?p=/${fileName}`);
|
||||
export async function catFile(config: Config, folder: string, fileName: string): Promise<ArrayBuffer> {
|
||||
const downloadUrlResponse = await fetchWithAuth(config, `${config.URL}/${config.REPO}/file/?p=/${folder}/${fileName}`);
|
||||
const downloadUrl = (await downloadUrlResponse.text()).replace(/"/g, '');
|
||||
const content = await (await fetchWithAuth(config, downloadUrl)).text();
|
||||
return content
|
||||
|
||||
// Download file sebagai binary, BUKAN text
|
||||
const fileResponse = await fetchWithAuth(config, downloadUrl);
|
||||
const buffer = await fileResponse.arrayBuffer();
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
export async function uploadFile(config: Config, file: File): Promise<string> {
|
||||
|
||||
Reference in New Issue
Block a user