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

support use meta.k8sResource to override resource name #19

Merged
merged 1 commit into from
Oct 17, 2023

Conversation

Yuyz0112
Copy link
Member

In k8s, we may have resources like this:

  • /api/v1/pods
  • /apis/metrics.k8s.io/v1beta1/pods

Currently, we are using refine's resource as the last part of the URL. Since resource is one of the most essential concepts in Refine, we'd better let these resources use different names in Refine. Then user can define k8sResource in the meta to let our API provider know how to construct an object.

For example:

{
  resource: 'pods',
},
{
  resource: 'podMetrics',
  meta: {
    k8sResource: 'pods'
  }
}

Copy link
Member

@self-transition self-transition left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Yuyz0112 Yuyz0112 merged commit d61b4ae into main Oct 17, 2023
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

Successfully merging this pull request may close these issues.

2 participants