]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/models/user/user-notification.ts
Move typescript utils in its own directory
[github/Chocobozzz/PeerTube.git] / server / models / user / user-notification.ts
index a7f84e9cabee0447a7afe57d8f376b8e4548cbe2..4a9a84a5bd44f3a5976d2077ef6a5fe51aff041d 100644 (file)
@@ -1,7 +1,8 @@
 import { FindOptions, ModelIndexesOptions, Op, WhereOptions } from 'sequelize'
 import { AllowNull, BelongsTo, Column, CreatedAt, Default, ForeignKey, Is, Model, Scopes, Table, UpdatedAt } from 'sequelize-typescript'
+import { uuidToShort } from '@shared/core-utils/uuid'
 import { UserNotificationIncludes, UserNotificationModelForApi } from '@server/types/models/user'
-import { AttributesOnly } from '@shared/core-utils'
+import { AttributesOnly } from '@shared/typescript-utils'
 import { UserNotification, UserNotificationType } from '../../../shared'
 import { isBooleanValid } from '../../helpers/custom-validators/misc'
 import { isUserNotificationTypeValid } from '../../helpers/custom-validators/user-notifications'
@@ -615,6 +616,7 @@ export class UserNotificationModel extends Model<Partial<AttributesOnly<UserNoti
     return {
       id: video.id,
       uuid: video.uuid,
+      shortUUID: uuidToShort(video.uuid),
       name: video.name
     }
   }
@@ -628,6 +630,7 @@ export class UserNotificationModel extends Model<Partial<AttributesOnly<UserNoti
           ? {
             id: abuse.VideoCommentAbuse.VideoComment.Video.id,
             name: abuse.VideoCommentAbuse.VideoComment.Video.name,
+            shortUUID: uuidToShort(abuse.VideoCommentAbuse.VideoComment.Video.uuid),
             uuid: abuse.VideoCommentAbuse.VideoComment.Video.uuid
           }
           : undefined