fix(Delegate): thumbnail and cover removal, logic issue
This commit is contained in:
parent
7d7083a576
commit
d7841b3c47
1 changed files with 16 additions and 6 deletions
|
@ -253,8 +253,13 @@ export default class DelegateController {
|
|||
const publishedVersion: any = res.locals.organization.publishedVersion
|
||||
if (
|
||||
Utils.isStrUsable(proposedVersion, 'thumbnail.location') &&
|
||||
(
|
||||
(
|
||||
Utils.isStrUsable(publishedVersion, 'thumbnail.location') &&
|
||||
publishedVersion.thumbnail.location !== proposedVersion.thumbnail.location
|
||||
) ||
|
||||
!Utils.isStrUsable(publishedVersion, 'thumbnail.location')
|
||||
)
|
||||
) {
|
||||
MediaService.delete(proposedVersion.thumbnail.key, 'thumbnailUpdated')
|
||||
}
|
||||
|
@ -281,8 +286,13 @@ export default class DelegateController {
|
|||
const publishedVersion: any = res.locals.organization.publishedVersion
|
||||
if (
|
||||
Utils.isStrUsable(proposedVersion, 'cover.location') &&
|
||||
(
|
||||
(
|
||||
Utils.isStrUsable(publishedVersion, 'cover.location') &&
|
||||
publishedVersion.cover.location !== proposedVersion.cover.location
|
||||
) ||
|
||||
!Utils.isStrUsable(publishedVersion, 'cover.location')
|
||||
)
|
||||
) {
|
||||
MediaService.delete(proposedVersion.cover.key, 'coverUpdated')
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue