From c5c95361e6adca439ae316066366e520797f9ec0 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 22 Feb 2023 16:15:14 +0100 Subject: Move to new documentation links --- server/middlewares/doc.ts | 2 +- server/middlewares/error.ts | 2 +- server/tests/api/check-params/videos.ts | 10 +++++----- server/tests/api/server/follow-constraints.ts | 2 +- server/tools/README.md | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) (limited to 'server') diff --git a/server/middlewares/doc.ts b/server/middlewares/doc.ts index eef76acaa..c43f41977 100644 --- a/server/middlewares/doc.ts +++ b/server/middlewares/doc.ts @@ -5,7 +5,7 @@ function openapiOperationDoc (options: { operationId?: string }) { return (req: express.Request, res: express.Response, next: express.NextFunction) => { - res.locals.docUrl = options.url || 'https://docs.joinpeertube.org/api-rest-reference.html#operation/' + options.operationId + res.locals.docUrl = options.url || 'https://docs.joinpeertube.org/api/rest-reference.html#operation/' + options.operationId if (next) return next() } diff --git a/server/middlewares/error.ts b/server/middlewares/error.ts index 96a85012a..7b116eb57 100644 --- a/server/middlewares/error.ts +++ b/server/middlewares/error.ts @@ -28,7 +28,7 @@ function apiFailMiddleware (req: express.Request, res: express.Response, next: e detail: message, type: type - ? `https://docs.joinpeertube.org/api-rest-reference.html#section/Errors/${type}` + ? `https://docs.joinpeertube.org/api/rest-reference.html#section/Errors/${type}` : undefined }, extension) diff --git a/server/tests/api/check-params/videos.ts b/server/tests/api/check-params/videos.ts index 572ca8997..2a83143e2 100644 --- a/server/tests/api/check-params/videos.ts +++ b/server/tests/api/check-params/videos.ts @@ -421,9 +421,9 @@ describe('Test videos API validator', function () { const error = body as unknown as PeerTubeProblemDocument if (mode === 'legacy') { - expect(error.docs).to.equal('https://docs.joinpeertube.org/api-rest-reference.html#operation/uploadLegacy') + expect(error.docs).to.equal('https://docs.joinpeertube.org/api/rest-reference.html#operation/uploadLegacy') } else { - expect(error.docs).to.equal('https://docs.joinpeertube.org/api-rest-reference.html#operation/uploadResumableInit') + expect(error.docs).to.equal('https://docs.joinpeertube.org/api/rest-reference.html#operation/uploadResumableInit') } expect(error.type).to.equal('about:blank') @@ -680,7 +680,7 @@ describe('Test videos API validator', function () { const res = await makePutBodyRequest({ url: server.url, path: path + video.shortUUID, token: server.accessToken, fields }) const error = res.body as PeerTubeProblemDocument - expect(error.docs).to.equal('https://docs.joinpeertube.org/api-rest-reference.html#operation/putVideo') + expect(error.docs).to.equal('https://docs.joinpeertube.org/api/rest-reference.html#operation/putVideo') expect(error.type).to.equal('about:blank') expect(error.title).to.equal('Bad Request') @@ -729,7 +729,7 @@ describe('Test videos API validator', function () { const body = await server.videos.get({ id: 'hi', expectedStatus: HttpStatusCode.BAD_REQUEST_400 }) const error = body as unknown as PeerTubeProblemDocument - expect(error.docs).to.equal('https://docs.joinpeertube.org/api-rest-reference.html#operation/getVideo') + expect(error.docs).to.equal('https://docs.joinpeertube.org/api/rest-reference.html#operation/getVideo') expect(error.type).to.equal('about:blank') expect(error.title).to.equal('Bad Request') @@ -835,7 +835,7 @@ describe('Test videos API validator', function () { const body = await server.videos.remove({ id: 'hello', expectedStatus: HttpStatusCode.BAD_REQUEST_400 }) const error = body as PeerTubeProblemDocument - expect(error.docs).to.equal('https://docs.joinpeertube.org/api-rest-reference.html#operation/delVideo') + expect(error.docs).to.equal('https://docs.joinpeertube.org/api/rest-reference.html#operation/delVideo') expect(error.type).to.equal('about:blank') expect(error.title).to.equal('Bad Request') diff --git a/server/tests/api/server/follow-constraints.ts b/server/tests/api/server/follow-constraints.ts index ff5332858..704d6fc96 100644 --- a/server/tests/api/server/follow-constraints.ts +++ b/server/tests/api/server/follow-constraints.ts @@ -146,7 +146,7 @@ describe('Test follow constraints', function () { const body = await servers[0].videos.get({ id: video2UUID, expectedStatus: HttpStatusCode.FORBIDDEN_403 }) const error = body as unknown as PeerTubeProblemDocument - const doc = 'https://docs.joinpeertube.org/api-rest-reference.html#section/Errors/does_not_respect_follow_constraints' + const doc = 'https://docs.joinpeertube.org/api/rest-reference.html#section/Errors/does_not_respect_follow_constraints' expect(error.type).to.equal(doc) expect(error.code).to.equal(ServerErrorCode.DOES_NOT_RESPECT_FOLLOW_CONSTRAINTS) diff --git a/server/tools/README.md b/server/tools/README.md index 449c57ce1..dab61e73e 100644 --- a/server/tools/README.md +++ b/server/tools/README.md @@ -1,3 +1,3 @@ # PeerTube CLI -See https://docs.joinpeertube.org/maintain-tools?id=remote-tools +See https://docs.joinpeertube.org/maintain/tools?id=remote-tools -- cgit v1.2.3