feat: Store image uploads as attachments in database (#1144)

* First pass

* Documentation

* Added optional documentId relationship

* name -> key

* cleanup: No need for separate documentId prop
This commit is contained in:
Tom Moor
2020-01-16 09:42:42 -08:00
committed by GitHub
parent 22230c25e5
commit 8e5a5a57a9
8 changed files with 171 additions and 31 deletions

View File

@ -15,6 +15,7 @@ import Embed from './Embed';
import embeds from '../../embeds';
type Props = {
id: string,
defaultValue?: string,
readOnly?: boolean,
grow?: boolean,
@ -28,7 +29,7 @@ class Editor extends React.Component<Props> {
@observable redirectTo: ?string;
onUploadImage = async (file: File) => {
const result = await uploadFile(file);
const result = await uploadFile(file, { documentId: this.props.id });
return result.url;
};