Skip to content

Commit

Permalink
Merge commit 'd409ead68ed48a60c2f0afdf3895476e9e92fa64'
Browse files Browse the repository at this point in the history
  • Loading branch information
affka committed Apr 22, 2024
2 parents e994522 + d409ead commit 7ac755b
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
1 change: 0 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ jobs:
- run: yarn
- run: yarn build
- run: cp ./{package.json,LICENSE,README.md,index.js} dist/
- run: cp -r ./src/project/usecases/templates dist/project/usecases/templates
- uses: JS-DevTools/npm-publish@v1
with:
package: ./dist/package.json
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@steroidsjs/gii-fs",
"version": "0.0.11",
"version": "0.0.14",
"description": "FS Developer Server",
"author": "Vladimir Kozhin <hello@kozhindev.com>",
"repository": {
Expand Down
8 changes: 8 additions & 0 deletions src/project/infrastructure/controllers/ProjectController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ export class ProjectController {
return this.projectService.getProjectStructureItem(projectName, id);
}

@Get('/project/:projectName/structures')
async getStructureItems(
@Param('projectName') projectName: string,
@Query('ids') ids: string[],
) {
return this.projectService.getProjectStructureItems(projectName, ids);
}

@Post('/project/:projectName/structure/preview')
async previewStructureItem(
@Param('projectName') projectName: string,
Expand Down
11 changes: 11 additions & 0 deletions src/project/usecases/services/ProjectService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,17 @@ export class ProjectService {
return parse(project, item.type, file);
}

public async getProjectStructureItems(projectName: string, ids: string[] = []) {
const project = await this.getProject(projectName);

return ids.map(id => {
const item = findInProjectStructure(project.structure, id);

const file = loadFile(project.path, item.id);
return parse(project, item.type, file);
})
}

public async previewProjectStructureItem(projectName, id, dto) {
const diffs = [];
const project = await this.getProject(projectName);
Expand Down

0 comments on commit 7ac755b

Please sign in to comment.