feat: delete suffix .json while import & create

This commit is contained in:
kungfuboy 2022-06-17 22:47:15 +08:00
parent 2f5a103866
commit 249e5d7c97

View File

@ -161,7 +161,7 @@ export class ApiGroupTreeComponent implements OnInit, OnDestroy {
];
}
async createGroup({ name, projectID, content }) {
const groupID = await this.storageInstance.group.add({ name, projectID });
const groupID = await this.storageInstance.group.add({ name: name.replace(/\.json$/, ''), projectID });
const result = content.apiData.map((it, index) => ({ ...it, groupID, uuid: Date.now() + index }));
await this.storageInstance.apiData.bulkAdd(result);
this.buildGroupTreeData();