diff options
author | Chocobozzz <me@florianbigard.com> | 2021-07-06 09:55:05 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-07-20 15:27:16 +0200 |
commit | e8bd7ce7ccafe3e064b03978e9b512c1a4cc99e6 (patch) | |
tree | c888e13aca3fc239f46d44045df6bf8e2a2ef0d3 /shared/extra-utils/requests/requests.ts | |
parent | 329619b3453479f76c049816b7403b86e9d45cb5 (diff) | |
download | PeerTube-e8bd7ce7ccafe3e064b03978e9b512c1a4cc99e6.tar.gz PeerTube-e8bd7ce7ccafe3e064b03978e9b512c1a4cc99e6.tar.zst PeerTube-e8bd7ce7ccafe3e064b03978e9b512c1a4cc99e6.zip |
Introduce CustomPage command
Diffstat (limited to 'shared/extra-utils/requests/requests.ts')
-rw-r--r-- | shared/extra-utils/requests/requests.ts | 5 |
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 | ||
185 | function unwrap <T> (test: request.Test): Promise<T> { | ||
186 | return test.then(res => res.body) | ||
187 | } | ||
188 | |||
185 | // --------------------------------------------------------------------------- | 189 | // --------------------------------------------------------------------------- |
186 | 190 | ||
187 | export { | 191 | export { |
@@ -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 | } |