mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-03-24 16:51:26 +00:00
Change api route to /api/private (#1189)
This commit is contained in:
parent
344304f329
commit
29d9d49f5a
20 changed files with 11 additions and 11 deletions
|
@ -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
|
||||
})
|
||||
|
|
|
@ -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
|
||||
})
|
||||
})
|
||||
|
|
|
@ -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: []
|
||||
|
|
|
@ -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')
|
||||
})
|
||||
})
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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': {
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue