🔨 Refactor: refactor of some apis

This commit is contained in:
萌萌哒赫萝
2023-06-29 05:00:46 -07:00
parent 6680434231
commit 8a70975cda
7 changed files with 147 additions and 66 deletions

View File

@@ -22,10 +22,10 @@ const apiMap: IStringKeyMap = {
export default class ALLApi {
static async delete (configMap: IStringKeyMap): Promise<boolean> {
if (apiMap[configMap.type] !== undefined) {
return await apiMap[configMap.type].delete(configMap)
} else {
return false
const api = apiMap[configMap.type]
if (api) {
return await api.delete(configMap)
}
return false
}
}