Skip to content

Commit

Permalink
feat: 0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
kungfuboy committed Feb 9, 2023
1 parent 8d4c881 commit 3d18b48
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "postcat",
"souceLocale": "zh-Hans",
"version": "0.1.0",
"version": "0.2.0",
"main": "out/app/electron-main/main.js",
"description": "A lightweight, extensible API tool",
"homepage": "https://github.com/eolinker/postcat.git",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ import { ApiEffectService } from '../../../service/store/api-effect.service';
import { ApiStoreService } from '../../../service/store/api-state.service';

export type GroupAction = 'new' | 'edit' | 'delete';

const getAllAPIId = ({ id, children = [] }) => {
return [id, ...children.map(getAllAPIId)];
};
@Component({
selector: 'pc-api-group-tree',
templateUrl: './api-group-tree.component.html',
Expand Down Expand Up @@ -135,11 +139,14 @@ export class ApiGroupTreeComponent implements OnInit {
nzTitle: title,
nzContent: ApiGroupEditComponent,
nzComponentParams: params,
nzOnOk: () =>
modal.componentInstance.submit().then(data => {
nzOnOk: () => {
console.log('this.apiGroupTree', params.group);
// const idList = getAllAPIId(params.group)
return modal.componentInstance.submit().then(data => {
if (params.action !== 'new') return;
this.expandKeys = [...(this.expandKeys || []), modal.componentInstance.group.parentId];
})
});
}
});
}
editGroup(group) {
Expand Down

0 comments on commit 3d18b48

Please sign in to comment.