fix(server/user/me): shortUUID response

pull/5125/head
kontrollanten 2022-10-01 17:09:40 +02:00
parent f1a0412391
commit e3f1ee4e33
2 changed files with 5 additions and 1 deletions

View File

@ -114,7 +114,7 @@ enum ScopeNames {
]
},
{
attributes: [ 'id', 'name', 'type' ],
attributes: [ 'id', 'name', 'type', 'uuid' ],
model: VideoPlaylistModel.unscoped(),
required: true,
where: {

View File

@ -1,6 +1,7 @@
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
import { expect } from 'chai'
import short from 'short-uuid'
import { testImage } from '@server/tests/shared'
import { AbuseState, HttpStatusCode, OAuth2ErrorCode, UserAdminFlag, UserRole, VideoPlaylistType } from '@shared/models'
import {
@ -12,6 +13,8 @@ import {
setAccessTokensToServers
} from '@shared/server-commands'
const translator = short()
describe('Test users', function () {
let server: PeerTubeServer
let token: string
@ -229,6 +232,7 @@ describe('Test users', function () {
expect(userGet.adminFlags).to.equal(UserAdminFlag.BYPASS_VIDEO_AUTO_BLACKLIST)
expect(userMe.specialPlaylists).to.have.lengthOf(1)
expect(userMe.specialPlaylists[0].shortUUID).to.have.lengthOf(translator.maxLength)
expect(userMe.specialPlaylists[0].type).to.equal(VideoPlaylistType.WATCH_LATER)
// Check stats are included with withStats