April 2020
Intermediate to advanced
716 pages
18h 55m
English
The media edit form, which will allow an authorized user to make changes to the details of a media post, will be similar to the new media form. However, it will not have an upload option, and the fields will be pre-populated with the existing values, as shown in the following screenshot:

The EditMedia component containing this form will fetch the existing values of the media by calling the read media API in a useEffect hook, as shown in the following code.
mern-mediastream/client/media/EditMedia.js:
useEffect(() => { const abortController = new AbortController() const signal = abortController.signal read({mediaId: match.params.mediaId}).then((data) ...Read now
Unlock full access