generated from azures04/Base-REST-API
Update productsFileService.js
This commit is contained in:
parent
4e70d59c63
commit
33482e0b41
@ -60,7 +60,7 @@ async function getProductFiles(productName, platform) {
|
||||
|
||||
async function getFile(basePath, productName, productPlatform) {
|
||||
try {
|
||||
const fixedPath = path.join(productsDataPath, productName, productPlatform, decodeURI(basePath))
|
||||
const fixedPath = path.join(productsDataPath, productName, "files", productPlatform, decodeURI(basePath))
|
||||
const fileMetadata = await fs.promises.stat(fixedPath)
|
||||
if (fileMetadata.isDirectory()) {
|
||||
throw new DefaultError(409, "Can't download a directory", "", "NotDownloadableException")
|
||||
@ -76,8 +76,8 @@ async function getFile(basePath, productName, productPlatform) {
|
||||
}
|
||||
}
|
||||
|
||||
async function canAccess(productName, productPlatform) {
|
||||
const fixedPath = path.join(productsDataPath, productName, productPlatform, ".brikcfg")
|
||||
async function canAccess(productName) {
|
||||
const fixedPath = path.join(productsDataPath, productName, "files", ".brikcfg")
|
||||
const fileState = await fs.promises.exists(fixedPath, fs.constants.F_OK)
|
||||
if (!fileState) {
|
||||
return { code: 200 }
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user