Added the getMediaById method to the media controller
This commit is contained in:
parent
fee00cc143
commit
edf7f6c25a
@ -12,7 +12,13 @@ export const createMedia = (clientId: number, assetName: string, assetEnding: st
|
||||
Media.create({clientId, assetName, assetEnding: assetEnding || "txt"});
|
||||
|
||||
/**
|
||||
* Gets a media object by the asset id
|
||||
* Gets a media object from an id
|
||||
* @param assetId The id of the asset to search
|
||||
*/
|
||||
export const getMediaById = (assetId: string) => Media.findOne({assetId}, {_id: 0, __v: 0});
|
||||
|
||||
/**
|
||||
* Gets a complete media object by the asset id
|
||||
* @param assetId The id of the asset to search
|
||||
*/
|
||||
export const getMediaObject = (assetId: string) => Media.findOne({assetId});
|
||||
|
Loading…
x
Reference in New Issue
Block a user