Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save to firestore after upload photos is not working? #600

Closed
dirathea opened this issue Dec 29, 2018 · 2 comments
Closed

Save to firestore after upload photos is not working? #600

dirathea opened this issue Dec 29, 2018 · 2 comments

Comments

@dirathea
Copy link
Contributor

What is the current behavior?
I'm using react-redux-firebase@next with firestore, and tried to use firebase.uploadFiles. The file is uploaded but the record is not saved on firebase even the configuration is already set up :

config

const rrfConfig = {
  userProfile: 'users',
  useFirestoreForProfile: true,
  useFirestoreForStorageMeta: true,
  enableLogging: false,
};

export const rrfProps = {
  firebase,
  config: rrfConfig,
  dispatch: store.dispatch,
  createFirestoreInstance,
};

implementation


const uploadPath = 'images';
class UploadField extends Component {
  onDrop = files => {
    this.props.firebase
      .uploadFiles(uploadPath, files, uploadPath)
      .then(result => {
        console.log(result);
      });
  };

  render() {
    return (
      <Dropzone onDrop={this.onDrop}>
      </Dropzone>
    );
  }
}

export default compose(
  withFirebase
)(UploadField);

What is the expected behavior?

The file uploaded and record is added

Thanks.

@dirathea
Copy link
Contributor Author

Ah turns out, the config must include firebase.database in this line even I only use firestore and state useFirestoreForStorageMeta on config.

Am I doing it wrong or it should be configure without firebase database if the user only use firestore?

@prescottprue prescottprue mentioned this issue Jan 1, 2019
3 tasks
prescottprue added a commit that referenced this issue Jan 1, 2019
* fix(storage): support only firestore when calling upload and writing - #600, #601
@prescottprue
Copy link
Owner

Fixed in both v2.2.6 and v3.0.0-alpha.4. Thanks for the PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants