Monday, 1 August 2022

pull data from FireStore

I'm trying to write code that receives data from FireStore and passes it to UI. I have four nodes in total, three of which I have already made, but on the fourth node I get an error in the browser console:

enter image description here

RecordDescription.js

export class RecordDescription {
    constructor(description = {}) {
        this.id = description.id;
      
    }
    toString() {
        return `
        ---|${this.id}|---\n
        `
    }
}

// Firestore data converter
export var recordDescriptionConverter = {
    toFirestore: function (description) {
        return {
            id: description.id,
            
        };
    },
    fromFirestore: function (snapshot, options) {
        const data = snapshot.data(options);
        return new RecordDescription(data);
    }
};

Please tell me what I need to fix to avoid this error. If any additional code is needed for the answer, let me know



from pull data from FireStore

No comments:

Post a Comment