Change api route to /api/private (#1189)

This commit is contained in:
Philip Molares 2021-04-15 22:10:15 +02:00 committed by GitHub
parent 344304f329
commit 29d9d49f5a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 11 additions and 11 deletions

View file

@ -31,7 +31,7 @@ describe('File upload', () => {
beforeEach(() => {
cy.intercept({
method: 'POST',
url: '/api/v2/media/upload'
url: '/api/private/media/upload'
}, {
statusCode: 201,
body: {
@ -86,7 +86,7 @@ describe('File upload', () => {
it('upload fails', () => {
cy.intercept({
method: 'POST',
url: '/api/v2/media/upload'
url: '/api/private/media/upload'
}, {
statusCode: 400
})

View file

@ -26,7 +26,7 @@ describe('History', () => {
describe('Pinning', () => {
describe('working', () => {
beforeEach(() => {
cy.intercept('PUT', '/api/v2/history/features', (req) => {
cy.intercept('PUT', '/api/private/history/features', (req) => {
req.reply(200, req.body)
})
})
@ -60,7 +60,7 @@ describe('History', () => {
describe('failing', () => {
beforeEach(() => {
cy.intercept('PUT', '/api/v2/history/features', {
cy.intercept('PUT', '/api/private/history/features', {
statusCode: 401
})
})

View file

@ -7,7 +7,7 @@
describe('profile page', () => {
beforeEach(() => {
cy.intercept({
url: '/api/v2/tokens',
url: '/api/private/tokens',
method: 'GET'
}, {
body: [
@ -18,7 +18,7 @@ describe('profile page', () => {
]
})
cy.intercept({
url: '/api/v2/tokens',
url: '/api/private/tokens',
method: 'POST'
}, {
body: {
@ -28,7 +28,7 @@ describe('profile page', () => {
}
})
cy.intercept({
url: '/api/v2/tokens/1601991518',
url: '/api/private/tokens/1601991518',
method: 'DELETE'
}, {
body: []

View file

@ -83,7 +83,7 @@ describe('When logged-out ', () => {
cy.get('[data-cy=sign-in-button]')
.should('be.visible')
// The absolute URL is used because it is defined as API base URL absolute.
.should('have.attr', 'href', 'http://127.0.0.1:3001/api/v2/auth/saml')
.should('have.attr', 'href', 'http://127.0.0.1:3001/api/private/auth/saml')
})
})

View file

@ -63,7 +63,7 @@ export const config = {
}
Cypress.Commands.add('loadConfig', (additionalConfig?: Partial<typeof config>) => {
return cy.intercept('/api/v2/config', {
return cy.intercept('/api/private/config', {
statusCode: 200,
body: {
...config,

View file

@ -17,7 +17,7 @@ Cypress.Commands.add('visitTestEditor', (query?: string) => {
})
beforeEach(() => {
cy.intercept(`/api/v2/notes/${ testNoteId }-get`, {
cy.intercept(`/api/private/notes/${ testNoteId }-get`, {
'id': 'ABC123',
'alias': 'banner',
'lastChange': {

View file

@ -12,7 +12,7 @@ import { getAndSetUser } from '../../login-page/auth/utils'
export const loadAllConfig: (baseUrl: string) => Promise<void> = async (baseUrl) => {
setApiUrl({
apiUrl: (process.env.REACT_APP_BACKEND || baseUrl) + '/api/v2'
apiUrl: (process.env.REACT_APP_BACKEND || baseUrl) + '/api/private'
})
const config = await getConfig()