feat: field based media/public folders (#3208)
This commit is contained in:
@ -18,6 +18,7 @@ export interface ImplementationMediaFile {
|
||||
draft?: boolean;
|
||||
url?: string;
|
||||
file?: File;
|
||||
folder?: string;
|
||||
}
|
||||
|
||||
export interface UnpublishedEntryMediaFile {
|
||||
@ -264,6 +265,11 @@ export const unpublishedEntries = async (
|
||||
}
|
||||
};
|
||||
|
||||
export const blobToFileObj = (name: string, blob: Blob) => {
|
||||
const options = name.match(/.svg$/) ? { type: 'image/svg+xml' } : {};
|
||||
return new File([blob], name, options);
|
||||
};
|
||||
|
||||
export const getMediaAsBlob = async (path: string, id: string | null, readFile: ReadFile) => {
|
||||
let blob: Blob;
|
||||
if (path.match(/.svg$/)) {
|
||||
|
Reference in New Issue
Block a user