fix: add new videos to the front of the videos list (#904)

This commit is contained in:
connorhaugh
2024-03-18 12:58:59 -04:00
committed by GitHub
parent 60917c6ab5
commit b09729b55e

View File

@@ -140,7 +140,7 @@ export function addVideoFile(courseId, file, videoIds) {
const newVideoIds = newVideos.map(video => video.edxVideoId);
const parsedVideos = updateFileValues(newVideos, true);
dispatch(addModels({ modelType: 'videos', models: parsedVideos }));
dispatch(setVideoIds({ videoIds: videoIds.concat(newVideoIds) }));
dispatch(setVideoIds({ videoIds: newVideoIds.concat(videoIds) }));
} catch (error) {
dispatch(updateEditStatus({ editType: 'add', status: RequestStatus.FAILED }));
// eslint-disable-next-line