fix(server/user/me): shortUUID response

This commit is contained in:
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(), model: VideoPlaylistModel.unscoped(),
required: true, required: true,
where: { where: {

View File

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