diff options
Diffstat (limited to 'server')
-rw-r--r-- | server/middlewares/doc.ts | 2 | ||||
-rw-r--r-- | server/middlewares/error.ts | 2 | ||||
-rw-r--r-- | server/tests/api/check-params/videos.ts | 10 | ||||
-rw-r--r-- | server/tests/api/server/follow-constraints.ts | 2 | ||||
-rw-r--r-- | server/tools/README.md | 2 |
5 files changed, 9 insertions, 9 deletions
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: { | |||
5 | operationId?: string | 5 | operationId?: string |
6 | }) { | 6 | }) { |
7 | return (req: express.Request, res: express.Response, next: express.NextFunction) => { | 7 | return (req: express.Request, res: express.Response, next: express.NextFunction) => { |
8 | res.locals.docUrl = options.url || 'https://docs.joinpeertube.org/api-rest-reference.html#operation/' + options.operationId | 8 | res.locals.docUrl = options.url || 'https://docs.joinpeertube.org/api/rest-reference.html#operation/' + options.operationId |
9 | 9 | ||
10 | if (next) return next() | 10 | if (next) return next() |
11 | } | 11 | } |
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 | |||
28 | detail: message, | 28 | detail: message, |
29 | 29 | ||
30 | type: type | 30 | type: type |
31 | ? `https://docs.joinpeertube.org/api-rest-reference.html#section/Errors/${type}` | 31 | ? `https://docs.joinpeertube.org/api/rest-reference.html#section/Errors/${type}` |
32 | : undefined | 32 | : undefined |
33 | }, extension) | 33 | }, extension) |
34 | 34 | ||
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 () { | |||
421 | const error = body as unknown as PeerTubeProblemDocument | 421 | const error = body as unknown as PeerTubeProblemDocument |
422 | 422 | ||
423 | if (mode === 'legacy') { | 423 | if (mode === 'legacy') { |
424 | expect(error.docs).to.equal('https://docs.joinpeertube.org/api-rest-reference.html#operation/uploadLegacy') | 424 | expect(error.docs).to.equal('https://docs.joinpeertube.org/api/rest-reference.html#operation/uploadLegacy') |
425 | } else { | 425 | } else { |
426 | expect(error.docs).to.equal('https://docs.joinpeertube.org/api-rest-reference.html#operation/uploadResumableInit') | 426 | expect(error.docs).to.equal('https://docs.joinpeertube.org/api/rest-reference.html#operation/uploadResumableInit') |
427 | } | 427 | } |
428 | 428 | ||
429 | expect(error.type).to.equal('about:blank') | 429 | expect(error.type).to.equal('about:blank') |
@@ -680,7 +680,7 @@ describe('Test videos API validator', function () { | |||
680 | const res = await makePutBodyRequest({ url: server.url, path: path + video.shortUUID, token: server.accessToken, fields }) | 680 | const res = await makePutBodyRequest({ url: server.url, path: path + video.shortUUID, token: server.accessToken, fields }) |
681 | const error = res.body as PeerTubeProblemDocument | 681 | const error = res.body as PeerTubeProblemDocument |
682 | 682 | ||
683 | expect(error.docs).to.equal('https://docs.joinpeertube.org/api-rest-reference.html#operation/putVideo') | 683 | expect(error.docs).to.equal('https://docs.joinpeertube.org/api/rest-reference.html#operation/putVideo') |
684 | 684 | ||
685 | expect(error.type).to.equal('about:blank') | 685 | expect(error.type).to.equal('about:blank') |
686 | expect(error.title).to.equal('Bad Request') | 686 | expect(error.title).to.equal('Bad Request') |
@@ -729,7 +729,7 @@ describe('Test videos API validator', function () { | |||
729 | const body = await server.videos.get({ id: 'hi', expectedStatus: HttpStatusCode.BAD_REQUEST_400 }) | 729 | const body = await server.videos.get({ id: 'hi', expectedStatus: HttpStatusCode.BAD_REQUEST_400 }) |
730 | const error = body as unknown as PeerTubeProblemDocument | 730 | const error = body as unknown as PeerTubeProblemDocument |
731 | 731 | ||
732 | expect(error.docs).to.equal('https://docs.joinpeertube.org/api-rest-reference.html#operation/getVideo') | 732 | expect(error.docs).to.equal('https://docs.joinpeertube.org/api/rest-reference.html#operation/getVideo') |
733 | 733 | ||
734 | expect(error.type).to.equal('about:blank') | 734 | expect(error.type).to.equal('about:blank') |
735 | expect(error.title).to.equal('Bad Request') | 735 | expect(error.title).to.equal('Bad Request') |
@@ -835,7 +835,7 @@ describe('Test videos API validator', function () { | |||
835 | const body = await server.videos.remove({ id: 'hello', expectedStatus: HttpStatusCode.BAD_REQUEST_400 }) | 835 | const body = await server.videos.remove({ id: 'hello', expectedStatus: HttpStatusCode.BAD_REQUEST_400 }) |
836 | const error = body as PeerTubeProblemDocument | 836 | const error = body as PeerTubeProblemDocument |
837 | 837 | ||
838 | expect(error.docs).to.equal('https://docs.joinpeertube.org/api-rest-reference.html#operation/delVideo') | 838 | expect(error.docs).to.equal('https://docs.joinpeertube.org/api/rest-reference.html#operation/delVideo') |
839 | 839 | ||
840 | expect(error.type).to.equal('about:blank') | 840 | expect(error.type).to.equal('about:blank') |
841 | expect(error.title).to.equal('Bad Request') | 841 | 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 () { | |||
146 | const body = await servers[0].videos.get({ id: video2UUID, expectedStatus: HttpStatusCode.FORBIDDEN_403 }) | 146 | const body = await servers[0].videos.get({ id: video2UUID, expectedStatus: HttpStatusCode.FORBIDDEN_403 }) |
147 | const error = body as unknown as PeerTubeProblemDocument | 147 | const error = body as unknown as PeerTubeProblemDocument |
148 | 148 | ||
149 | const doc = 'https://docs.joinpeertube.org/api-rest-reference.html#section/Errors/does_not_respect_follow_constraints' | 149 | const doc = 'https://docs.joinpeertube.org/api/rest-reference.html#section/Errors/does_not_respect_follow_constraints' |
150 | expect(error.type).to.equal(doc) | 150 | expect(error.type).to.equal(doc) |
151 | expect(error.code).to.equal(ServerErrorCode.DOES_NOT_RESPECT_FOLLOW_CONSTRAINTS) | 151 | expect(error.code).to.equal(ServerErrorCode.DOES_NOT_RESPECT_FOLLOW_CONSTRAINTS) |
152 | 152 | ||
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 @@ | |||
1 | # PeerTube CLI | 1 | # PeerTube CLI |
2 | 2 | ||
3 | See https://docs.joinpeertube.org/maintain-tools?id=remote-tools | 3 | See https://docs.joinpeertube.org/maintain/tools?id=remote-tools |