Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,15 @@ describe('queryToResourcePath', () => {
)
})

it('should return an unversioned endpoint sub-resources of the new tracker importer (in version 2.37)', () => {
const query: ResolvedResourceQuery = {
resource: 'tracker/test',
}
expect(queryToResourcePath(link, query, 'read')).toBe(
`${link.unversionedApiPath}/tracker/test`
)
})

it('should return a VERSIONED endpoint for the new tracker importer (in version 2.38)', () => {
const query: ResolvedResourceQuery = {
resource: 'tracker',
Expand Down
2 changes: 1 addition & 1 deletion services/data/src/links/RestAPILink/queryToResourcePath.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const makeActionPath = (resource: string) =>
)

const skipApiVersion = (resource: string, config: Config): boolean => {
if (resource === 'tracker') {
if (resource === 'tracker' || resource.startsWith('tracker/')) {
if (!config.serverVersion?.minor || config.serverVersion?.minor < 38) {
return true
}
Expand Down