Skip to content

Commit e20e222

Browse files
committed
fetch from github assets
1 parent 63fc0ff commit e20e222

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/blocks/block-catalog.service.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,11 @@ export class BlockCatalogService {
6161

6262
// const fileName = `${this.capitalize(blockId)}.json`;
6363
const fileName = block.file || `${this.capitalize(blockId)}.json`;
64-
const fullPath = join(__dirname, `../assets/assets/collection/${category}/${fileName}`);
65-
const fileContent = await fs.readFile(fullPath, 'utf8');
64+
// const fullPath = join(__dirname, `../assets/assets/collection/${category}/${fileName}`);
65+
// const fileContent = await fs.readFile(fullPath, 'utf8');
66+
67+
const response = await fetch(`https://raw.githubusercontent.com/offboard-studio/offboard.studio.components.store/refs/heads/main/src/assets/collection/${category}/${fileName}`);
68+
const fileContent = await response.text();
6669

6770
return {
6871
label: block.label,

0 commit comments

Comments
 (0)