Skip to content

Commit

Permalink
feat: Allow json files to be at root level (#257)
Browse files Browse the repository at this point in the history
  • Loading branch information
IIBenII authored May 27, 2024
1 parent bb9da61 commit 84c141c
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion packages/dbt-backend/src/service/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,17 @@ export async function createRouter(options: RouterOptions): Promise<express.Rout
const bucketPath = req.query.bucketPath;
const backend = config.getString('dbtdoc.backend')

const filePath = bucketPath ? `${bucketPath}/${type}.json` : `${kind}/${name}/${type}.json`;
let filePath: string;

if (bucketPath == ".") {
filePath = `${type}.json`;
}
else if (bucketPath) {
filePath = `${bucketPath}/${type}.json`;
}
else {
filePath = `${kind}/${name}/${type}.json`;
}
const fullPath = `${bucket}/${filePath}`;

let storageProvider: StorageProvider;
Expand Down

0 comments on commit 84c141c

Please sign in to comment.