Skip to content

Commit

Permalink
fix(API): janhq#1511 update swagger page (janhq#1572)
Browse files Browse the repository at this point in the history
Signed-off-by: James <[email protected]>
Co-authored-by: James <[email protected]>
  • Loading branch information
namchuai and James authored Jan 14, 2024
1 parent 4a2f5bc commit e7fcd77
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 393 deletions.
8 changes: 4 additions & 4 deletions core/src/node/api/common/builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export const retrieveBuilder = async (configuration: RouteConfiguration, id: str
const filteredData = data.filter((d: any) => d.id === id)[0]

if (!filteredData) {
return {}
return undefined
}

return filteredData
Expand All @@ -75,14 +75,14 @@ export const deleteBuilder = async (configuration: RouteConfiguration, id: strin
const directoryPath = join(path, configuration.dirName)
try {
const data = await retrieveBuilder(configuration, id)
if (!data || !data.keys) {
if (!data) {
return {
message: 'Not found',
}
}

const myPath = join(directoryPath, id)
fs.rmdirSync(myPath, { recursive: true })
const objectPath = join(directoryPath, id)
fs.rmdirSync(objectPath, { recursive: true })
return {
id: id,
object: configuration.delete.object,
Expand Down
Loading

0 comments on commit e7fcd77

Please sign in to comment.