resulturan / refine-firebase

MIT License
43 stars 22 forks source link

meta populate not populating related collections #11

Closed heromiyo closed 1 year ago

heromiyo commented 1 year ago

Am trying to populate customer which is a string that refers to a firestore document for a Customer but its populating const { listProps, setFilters, searchFormProps } = useSimpleList<IOrder, HttpError, ISearch>({ meta: { populate: { customer: { populate: ["customers"] }, createdBy: { populate: ["users"] }, }, },

My Interfaces

export interface ICustomer { id: string; dob: string | null, orderCount: number, district: string, lastName: string, firstName: string, employeeNumber: string, maritalStatus: string | null, nrc: string, institution: string, primaryPhoneNumber: string, createdBy: string, title: string, timeStamp: { seconds: number, nanoseconds: number }, department: string, secondaryPhoneNumber: string | null }

export interface IOrder { id: string; timeStamp: { seconds: number | null, nanoseconds: number | null }, customer: ICustomer, numberOfInstallments: string | null, reserveAttachment: boolean, lastName: string, comment: string | null, monthOfLastDeduct: string | null, itemNum: number, totalPrice: string, employeeNumber: string, formType: string, accountName: string | null, orderStatus: string, nrc: string, installmentAmount: string | null, isCollected: boolean, accountNumber: string | null, firstName: string, collectionDate: string | null, monthOfFirstDeduct: string | null, attachments: [] | null, createdBy: ICustomer, bankName: string | null, branchName: string | null }

anyway to get the related collections documents?

resulturan commented 1 year ago

I think you need to check the Firebase documentation.