This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import { fetchJson } from '../../shared/api/http.js';
|
||||
|
||||
export async function getAssets() {
|
||||
const response = await fetchJson('/api/assets');
|
||||
return response.assets;
|
||||
}
|
||||
|
||||
export async function uploadAsset({ dataUrl, fileName }) {
|
||||
const response = await fetchJson('/api/assets', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ dataUrl, fileName }),
|
||||
});
|
||||
|
||||
return response.asset;
|
||||
}
|
||||
Reference in New Issue
Block a user