mirror of https://github.com/Budibase/budibase.git
9 changed files with 91 additions and 21 deletions
@ -1,7 +1,15 @@ |
|||
exports.getRecordKey = (appname, wholePath) => |
|||
wholePath |
|||
.replace(`/${appname}/api/files/`, "") |
|||
.replace(`/${appname}/api/lookup_field/`, "") |
|||
.replace(`/${appname}/api/record/`, "") |
|||
.replace(`/${appname}/api/listRecords/`, "") |
|||
.replace(`/${appname}/api/aggregates/`, "") |
|||
this.getAppRelativePath(appname, wholePath) |
|||
.replace(`/api/files/`, "/") |
|||
.replace(`/api/lookup_field/`, "/") |
|||
.replace(`/api/record/`, "/") |
|||
.replace(`/api/listRecords/`, "/") |
|||
.replace(`/api/aggregates/`, "/") |
|||
|
|||
exports.getAppRelativePath = (appname, wholePath) => { |
|||
const builderInstanceRegex = new RegExp( |
|||
`\\/_builder\\/instance\\/[^\\/]*\\/[^\\/]*\\/` |
|||
) |
|||
|
|||
return wholePath.replace(builderInstanceRegex, "/").replace(`/${appname}`, "") |
|||
} |
|||
|
|||
Loading…
Reference in new issue