Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Fix cancelling ownership change request

Chocobozzz9bcaa4b8d982
diff --git a/client/src/app/+videos-publish-manage/shared-manage/main-info/video-main-info.component.ts b/client/src/app/+videos-publish-manage/shared-manage/main-info/video-main-info.component.ts
index 9d323c1613..f15d1c34af 100644
--- a/client/src/app/+videos-publish-manage/shared-manage/main-info/video-main-info.component.ts
+++ b/client/src/app/+videos-publish-manage/shared-manage/main-info/video-main-info.component.ts
@@ -522,7 +522,7 @@ export class VideoMainInfoComponent implements OnInit, OnDestroy {
const res = await this.confirmService.confirm(message, $localize`Cancel request`)
if (res === false) return
- this.videoOwnershipService.cancel(this.videoEdit.getVideoAttributes().id)
+ this.videoOwnershipService.cancel(this.pendingOwnershipRequest.id)
.subscribe({
next: () => {
this.notifier.success($localize`Ownership change request cancelled`)
diff --git a/client/src/app/shared/shared-main/video/video-ownership.service.ts b/client/src/app/shared/shared-main/video/video-ownership.service.ts
index e59a579dff..2ef3a45bfb 100644
--- a/client/src/app/shared/shared-main/video/video-ownership.service.ts
+++ b/client/src/app/shared/shared-main/video/video-ownership.service.ts
@@ -41,11 +41,11 @@ export class VideoOwnershipService {
.pipe(catchError(res => this.restExtractor.handleError(res)))
}
- listFromVideo (videoId: number, status: VideoChangeOwnershipStatusType): Observable<ResultList<VideoChangeOwnership>> {
+ listFromVideo (videoId: number, state: VideoChangeOwnershipStatusType): Observable<ResultList<VideoChangeOwnership>> {
const url = VideoOwnershipService.BASE_VIDEO_CHANGE_OWNERSHIP_URL + videoId + '/ownership'
let params = new HttpParams()
- params = params.set('status', status)
+ params = params.set('state', state)
return this.authHttp.get<ResultList<VideoChangeOwnership>>(url, { params })
.pipe(catchError(res => this.restExtractor.handleError(res)))
diff --git a/server/core/controllers/api/videos/ownership.ts b/server/core/controllers/api/videos/ownership.ts
index e41b58af75..4436d2c4d4 100644
--- a/server/core/controllers/api/videos/ownership.ts
+++ b/server/core/controllers/api/videos/ownership.ts
@@ -53,7 +53,7 @@ ownershipVideoRouter.get(
authenticate,
paginationValidator,
setDefaultPagination,
- asyncRetryTransactionMiddleware(listVideoOwnership)
+ asyncRetryTransactionMiddleware(listAccountOwnershipChanges)
)
ownershipVideoRouter.post(
@@ -131,7 +131,7 @@ async function giveVideoOwnership (req: express.Request, res: express.Response)
async function listVideoOwnershipChanges (req: express.Request, res: express.Response) {
const videoId = res.locals.videoWithRights.id
- const state = req.query.state as VideoChangeOwnershipStatusType | undefined
+ const state = req.query.state as VideoChangeOwnershipStatusType
const resultList = await VideoChangeOwnershipModel.listForApi({
videoId,
@@ -144,7 +144,7 @@ async function listVideoOwnershipChanges (req: express.Request, res: express.Res
return res.json(getFormattedObjects(resultList.data, resultList.total))
}
-async function listVideoOwnership (req: express.Request, res: express.Response) {
+async function listAccountOwnershipChanges (req: express.Request, res: express.Response) {
const currentAccountId = res.locals.oauth.token.User.Account.id
const resultList = await VideoChangeOwnershipModel.listForApi({