colossal-harlequinC
Refine3y ago
4 replies
colossal-harlequin

REST client uses resource name instead of what's set for list for getList requests

I’ve been following the tutorial on multitenancy Multitenancy

Imagine a SAAS app sending emails where the root is a list of organisations and each organisations can have email accounts assigned using SMTP.

My issue is that navigating to list smtp navigates to the right path in my refine app, but the REST API call to my backend is https://myapi.com/smtp instead of https://myapi.com/organization/1234/smtp.

I have the rest client swizzled, and getList: async ({ resource, pagination, filters, sorters, meta })
returns smtp instead of /organization/:organizationId/smtp as resource param. Show/edit/… seems to work fine, seems to be happening just for list requests.

Just wanted to confirm that I’m doing something wrong before filing a bug report.

This is my resources:

resources={[
                  {
                    name: "organization",
                    list: "/organization",
                    create: "/organization/create",
                    edit: "/organization/edit/:id",
                    show: "/organization/:id",
                    meta: {
                      canDelete: true
                    },
                  },
                  {
                    name: "smtp",
                    list: "/organization/:organizationId/smtp",
                    create: "/organization/:organizationId/smtp/create",
                    edit: "/organization/:organizationId/smtp/edit/:id",
                    show: "/organization/:organizationId/smtp/:id",
                    meta: {
                      canDelete: true,
                      organizationId
                    },
                  },
// ......
Refine's architecture allows you to customize your app's data providers, access control and routing to support multi tenant features easily. This guide will provide you with a high level overview of the concepts and how to implement them. To see multi tenant app examples, check out the Examples section.
Multitenancy | refine
Was this page helpful?