You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to make a backoffice for a marketplace to allow sellers to manage their products, orders, customers...
For exemple, sellers will login to www.mywebsite.com/admin (the backoffice that I develop with the react-admin library)
Each seller will have his firestore collections, for example :
For example, when "seller 1" log in and go to www.mywebsite.com/admin/products, he will see the list of his products, I want react-admin-firebase to retrieve the documents(products) of "root-collection/seller1/products" collection, when he create product, I want this new product to be stored in "root-collection/seller1/products". If "seller 2" create new category, I want the category to be stored in "root-collection/seller2/categories" ...
I try this, in options of FirebaseDataProvider, but not working :
...
const options = {
logging: true,
rootRef: () => {
const auth = getAuth();
const user = auth.currentUser;
if (user) {
// User is signed in
return 'root-collection/' + user.uid;
} else {
// No user is signed in.
return 'root-collection/foo';
}
},
app: firebaseApp,
...
it return always 'root-collection/foo' even if I signed in.
Do you have a solution for my use case ?
Thank you.
Sorry for my english.
The text was updated successfully, but these errors were encountered:
Hello,
I want to make a backoffice for a marketplace to allow sellers to manage their products, orders, customers...
For exemple, sellers will login to www.mywebsite.com/admin (the backoffice that I develop with the react-admin library)
Each seller will have his firestore collections, for example :
---- seller1 (document, "seller1" is equivalent to the "seller 1" uid )
---------- products (collection)
---------- categories (collection)
---------- orders (collection)
---- seller2 (document)
---------- products (collection)
---------- categories (collection)
---------- orders (collection)
....
For example, when "seller 1" log in and go to www.mywebsite.com/admin/products, he will see the list of his products, I want react-admin-firebase to retrieve the documents(products) of "root-collection/seller1/products" collection, when he create product, I want this new product to be stored in "root-collection/seller1/products". If "seller 2" create new category, I want the category to be stored in "root-collection/seller2/categories" ...
I try this, in options of FirebaseDataProvider, but not working :
it return always 'root-collection/foo' even if I signed in.
Do you have a solution for my use case ?
Thank you.
Sorry for my english.
The text was updated successfully, but these errors were encountered: