mirror of
https://github.com/sotam0316/drawNET.git
synced 2026-04-24 19:48:36 +09:00
18 lines
496 B
JavaScript
18 lines
496 B
JavaScript
import { state } from '../state.js';
|
|
import { logger } from '../utils/logger.js';
|
|
|
|
/**
|
|
* fetchAssets - Fetches the complete asset and pack list from the server
|
|
*/
|
|
export async function fetchAssets() {
|
|
try {
|
|
const response = await fetch('/assets');
|
|
const data = await response.json();
|
|
state.assetsData = data.assets || [];
|
|
return data;
|
|
} catch (e) {
|
|
logger.critical("Failed to fetch assets:", e);
|
|
return { assets: [], packs: [] };
|
|
}
|
|
}
|