Skip to content

Commit

Permalink
Adjusting odata paths for cds7
Browse files Browse the repository at this point in the history
  • Loading branch information
danjoa committed Jul 5, 2023
1 parent c089c97 commit fdd5351
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion data-viewer/app/viewer/app.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* global Vue axios */ //> from vue.html
const GET = (url) => axios.get('/-data'+url)
const GET = (url) => axios.get('/odata/v4/-data'+url)
const storageGet = (key, def) => localStorage.getItem('data-viewer:'+key) || def
const storageSet = (key, val) => localStorage.setItem('data-viewer:'+key, val)
const columnKeysFirst = (c1, c2) => {
Expand Down
2 changes: 1 addition & 1 deletion fiori/app/genres/webapp/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"resources": "resources.json",
"dataSources": {
"main": {
"uri": "/v2/browse",
"uri": "/odata/v2/browse",
"type": "OData",
"settings": {
"annotations": ["localAnnotations"],
Expand Down
2 changes: 1 addition & 1 deletion fiori/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ const cds = require("@sap/cds")
const proxy = require('@cap-js-community/odata-v2-adapter')
const opts = global.it ? { target:'auto' } : {} // for tests, set 'auto' to detect port dynamically
cds.on('bootstrap', app => app.use(proxy(opts))) // install proxy
cds.log('cov2ap','silent') // suppress anoying log outpout, e.g. for `npm run mocha -- --reporter nyan`
// cds.log('cov2ap','silent') // suppress anoying log outpout, e.g. for `npm run mocha -- --reporter nyan`

module.exports = require('@capire/bookstore/server.js')
2 changes: 1 addition & 1 deletion orders/app/orders/webapp/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"i18n": "i18n/i18n.properties",
"dataSources": {
"OrdersService": {
"uri": "/orders/",
"uri": "/odata/v4/orders/",
"type": "OData",
"settings": {
"odataVersion": "4.0"
Expand Down
4 changes: 2 additions & 2 deletions test/fiori.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ describe('cap/samples - Fiori APIs - v2', function() {
// if (this.timeout) this.timeout(1e6)

it('serves $metadata documents in v2', async () => {
const { headers, data } = await GET `/v2/browse/$metadata`
const { headers, data } = await GET `/odata/v2/browse/$metadata`
expect(headers).to.contain({
'content-type': 'application/xml',
'dataserviceversion': '2.0',
Expand All @@ -17,7 +17,7 @@ describe('cap/samples - Fiori APIs - v2', function() {
})

it('serves Books in v2', async () => {
const { data } = await GET `/v2/browse/Books`
const { data } = await GET `/odata/v2/browse/Books`
expect(data).to.containSubset({d:{results:[]}})
expect(data.d.results.length).to.be.greaterThanOrEqual(5)
})
Expand Down

0 comments on commit fdd5351

Please sign in to comment.