Skip to main content
zerotal

Documentation


Documentation / @zerotal/admin / index / deleteMedia

Function: deleteMedia()

deleteMedia(item, options): Promise<[true] | [false, string]>

Defined in: admin/src/media.ts:276

Remove a file from both the catalogue and the disk.

The catalogue entry goes first. If the disk delete then fails the result is an orphaned file — wasted space, but nothing broken — whereas the other order can leave the library offering a file that no longer exists.

Parameters

item

MediaItem

options

provider

MediaProvider

disk?

string

Returns

Promise<[true] | [false, string]>