From e94fc29706cd8e8fd892182d4de0a3ae80a3820f Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 18 Jun 2018 10:24:53 +0200 Subject: Fix removing scheduled update --- client/src/app/shared/video/video-edit.model.ts | 4 +++- client/src/app/shared/video/video.service.ts | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'client/src') diff --git a/client/src/app/shared/video/video-edit.model.ts b/client/src/app/shared/video/video-edit.model.ts index 78aed4f9f..8562f8d25 100644 --- a/client/src/app/shared/video/video-edit.model.ts +++ b/client/src/app/shared/video/video-edit.model.ts @@ -55,7 +55,7 @@ export class VideoEdit implements VideoUpdate { }) // If schedule publication, the video is private and will be changed to public privacy - if (values['schedulePublicationAt']) { + if (parseInt(values['privacy'], 10) === VideoEdit.SPECIAL_SCHEDULED_PRIVACY) { const updateAt = (values['schedulePublicationAt'] as Date) updateAt.setSeconds(0) @@ -64,6 +64,8 @@ export class VideoEdit implements VideoUpdate { updateAt: updateAt.toISOString(), privacy: VideoPrivacy.PUBLIC } + } else { + this.scheduleUpdate = null } } diff --git a/client/src/app/shared/video/video.service.ts b/client/src/app/shared/video/video.service.ts index 3af90e7ad..2da36ff1b 100644 --- a/client/src/app/shared/video/video.service.ts +++ b/client/src/app/shared/video/video.service.ts @@ -68,6 +68,7 @@ export class VideoService { const category = video.category || null const description = video.description || null const support = video.support || null + const scheduleUpdate = video.scheduleUpdate || null const body: VideoUpdate = { name: video.name, @@ -84,7 +85,7 @@ export class VideoService { commentsEnabled: video.commentsEnabled, thumbnailfile: video.thumbnailfile, previewfile: video.previewfile, - scheduleUpdate: video.scheduleUpdate || undefined + scheduleUpdate } const data = objectToFormData(body) -- cgit v1.2.3