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

View file

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

View file

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

View file

@ -83,7 +83,7 @@ describe('When logged-out ', () => {
cy.get('[data-cy=sign-in-button]') cy.get('[data-cy=sign-in-button]')
.should('be.visible') .should('be.visible')
// The absolute URL is used because it is defined as API base URL absolute. // 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>) => { Cypress.Commands.add('loadConfig', (additionalConfig?: Partial<typeof config>) => {
return cy.intercept('/api/v2/config', { return cy.intercept('/api/private/config', {
statusCode: 200, statusCode: 200,
body: { body: {
...config, ...config,

View file

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

View file

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