diff options
author | buoyantair <buoyantair@gmail.com> | 2018-10-29 22:18:31 +0530 |
---|---|---|
committer | buoyantair <buoyantair@gmail.com> | 2018-10-29 22:18:31 +0530 |
commit | 9639bd175726b73f8fe664b5ced12a72407b1f0b (patch) | |
tree | 689d4c9e0a1f8dcc55e0ba4e694af3b09bff2cad /shared/utils/videos/video-history.ts | |
parent | 71607e4a65d3a8904bcd418ab7acbc2f34f725ff (diff) | |
download | PeerTube-9639bd175726b73f8fe664b5ced12a72407b1f0b.tar.gz PeerTube-9639bd175726b73f8fe664b5ced12a72407b1f0b.tar.zst PeerTube-9639bd175726b73f8fe664b5ced12a72407b1f0b.zip |
Move utils to /shared
Move utils used by /server/tools/* & /server/tests/**/* into
/shared folder.
Issue: #1336
Diffstat (limited to 'shared/utils/videos/video-history.ts')
-rw-r--r-- | shared/utils/videos/video-history.ts | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/shared/utils/videos/video-history.ts b/shared/utils/videos/video-history.ts new file mode 100644 index 000000000..7635478f7 --- /dev/null +++ b/shared/utils/videos/video-history.ts | |||
@@ -0,0 +1,14 @@ | |||
1 | import { makePutBodyRequest } from '../requests/requests' | ||
2 | |||
3 | function userWatchVideo (url: string, token: string, videoId: number | string, currentTime: number) { | ||
4 | const path = '/api/v1/videos/' + videoId + '/watching' | ||
5 | const fields = { currentTime } | ||
6 | |||
7 | return makePutBodyRequest({ url, path, token, fields, statusCodeExpected: 204 }) | ||
8 | } | ||
9 | |||
10 | // --------------------------------------------------------------------------- | ||
11 | |||
12 | export { | ||
13 | userWatchVideo | ||
14 | } | ||