mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-04 18:29:27 +02:00
Don't import test tools in core
This commit is contained in:
parent
6cc98dfff3
commit
a8f378e02c
2 changed files with 3 additions and 5 deletions
|
@ -5,8 +5,7 @@ import { AccountVideoRateModel } from '../../../models/account/account-video-rat
|
|||
import { ActorModel } from '../../../models/activitypub/actor'
|
||||
import { forwardVideoRelatedActivity } from '../send/utils'
|
||||
import { getOrCreateVideoAndAccountAndChannel } from '../videos'
|
||||
import { immutableAssign } from '../../../tests/utils'
|
||||
import { getVideoDislikeActivityPubUrl, getVideoLikeActivityPubUrl } from '../url'
|
||||
import { getVideoLikeActivityPubUrl } from '../url'
|
||||
|
||||
async function processLikeActivity (activity: ActivityLike, byActor: ActorModel) {
|
||||
return retryTransactionWrapper(processLikeVideo, byActor, activity)
|
||||
|
@ -36,7 +35,7 @@ async function processLikeVideo (byActor: ActorModel, activity: ActivityLike) {
|
|||
}
|
||||
const [ , created ] = await AccountVideoRateModel.findOrCreate({
|
||||
where: rate,
|
||||
defaults: immutableAssign(rate, { url: getVideoLikeActivityPubUrl(byActor, video) }),
|
||||
defaults: Object.assign({}, rate, { url: getVideoLikeActivityPubUrl(byActor, video) }),
|
||||
transaction: t
|
||||
})
|
||||
if (created === true) await video.increment('likes', { transaction: t })
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue