ActivityPub-federated video streaming platform using P2P directly in your web browser
Wait for transaction before sending res
Chocobozzz7193cade5e4d
diff --git a/server/core/controllers/api/video-channels/ownership.ts b/server/core/controllers/api/video-channels/ownership.tsindex bda5bc9182..e2be70e951 100644--- a/server/core/controllers/api/video-channels/ownership.ts+++ b/server/core/controllers/api/video-channels/ownership.ts@@ -144,8 +144,8 @@ async function listAccountChannelOwnershipChanges (req: express.Request, res: exreturn res.json(getFormattedObjects(resultList.data, resultList.total))}-function acceptOwnershipChange (req: express.Request, res: express.Response) {- return sequelizeTypescript.transaction(async t => {+async function acceptOwnershipChange (req: express.Request, res: express.Response) {+ await sequelizeTypescript.transaction(async t => {const changeOwnership = res.locals.changeOwnershipconst channel = await VideoChannelModel.load(changeOwnership.VideoChannel.id, t)const previousOwnerId = channel.accountId@@ -184,13 +184,13 @@ function acceptOwnershipChange (req: express.Request, res: express.Response) {})Notifier.Instance.notifyOfAcceptedChannelOwnershipChange(changeOwnership)-- return res.sendStatus(HttpStatusCode.NO_CONTENT_204)})++ return res.sendStatus(HttpStatusCode.NO_CONTENT_204)}-function refuseOwnershipChange (req: express.Request, res: express.Response) {- return sequelizeTypescript.transaction(async t => {+async function refuseOwnershipChange (req: express.Request, res: express.Response) {+ await sequelizeTypescript.transaction(async t => {const changeOwnership = res.locals.changeOwnershipchangeOwnership.state = ChangeOwnershipState.REJECTED@@ -207,13 +207,13 @@ function refuseOwnershipChange (req: express.Request, res: express.Response) {})Notifier.Instance.notifyOfRejectedChannelOwnershipChange(changeOwnership)-- return res.sendStatus(HttpStatusCode.NO_CONTENT_204)})++ return res.sendStatus(HttpStatusCode.NO_CONTENT_204)}-function deleteOwnershipChange (req: express.Request, res: express.Response) {- return sequelizeTypescript.transaction(async t => {+async function deleteOwnershipChange (req: express.Request, res: express.Response) {+ await sequelizeTypescript.transaction(async t => {const changeOwnership = res.locals.changeOwnershipconst channel = await VideoChannelModel.loadAndPopulateAccount(changeOwnership.videoChannelId, t)@@ -228,7 +228,7 @@ function deleteOwnershipChange (req: express.Request, res: express.Response) {})logger.info('Channel ownership change request %d deleted.', changeOwnership.id)-- return res.sendStatus(HttpStatusCode.NO_CONTENT_204)})++ return res.sendStatus(HttpStatusCode.NO_CONTENT_204)}