aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils/requests
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-07-06 09:55:05 +0200
committerChocobozzz <me@florianbigard.com>2021-07-20 15:27:16 +0200
commite8bd7ce7ccafe3e064b03978e9b512c1a4cc99e6 (patch)
treec888e13aca3fc239f46d44045df6bf8e2a2ef0d3 /shared/extra-utils/requests
parent329619b3453479f76c049816b7403b86e9d45cb5 (diff)
downloadPeerTube-e8bd7ce7ccafe3e064b03978e9b512c1a4cc99e6.tar.gz
PeerTube-e8bd7ce7ccafe3e064b03978e9b512c1a4cc99e6.tar.zst
PeerTube-e8bd7ce7ccafe3e064b03978e9b512c1a4cc99e6.zip
Introduce CustomPage command
Diffstat (limited to 'shared/extra-utils/requests')
-rw-r--r--shared/extra-utils/requests/requests.ts5
1 files changed, 5 insertions, 0 deletions
diff --git a/shared/extra-utils/requests/requests.ts b/shared/extra-utils/requests/requests.ts
index 38e24d897..eb59ca600 100644
--- a/shared/extra-utils/requests/requests.ts
+++ b/shared/extra-utils/requests/requests.ts
@@ -182,6 +182,10 @@ function decodeQueryString (path: string) {
182 return decode(path.split('?')[1]) 182 return decode(path.split('?')[1])
183} 183}
184 184
185function unwrap <T> (test: request.Test): Promise<T> {
186 return test.then(res => res.body)
187}
188
185// --------------------------------------------------------------------------- 189// ---------------------------------------------------------------------------
186 190
187export { 191export {
@@ -194,5 +198,6 @@ export {
194 makePutBodyRequest, 198 makePutBodyRequest,
195 makeDeleteRequest, 199 makeDeleteRequest,
196 makeRawRequest, 200 makeRawRequest,
201 unwrap,
197 updateImageRequest 202 updateImageRequest
198} 203}