Conversation
Baltazore
reviewed
Nov 8, 2023
| // class to the prototype which can result in overwrite errors | ||
|
|
||
| interface BuildURLConfig { | ||
| export interface BuildURLConfig { |
Contributor
There was a problem hiding this comment.
@runspired I have a question, do you think it would be useful to allow users to overwrite function that does resourcePath conversion right here as part of BuildURLConfig?
Something like
BuildURLConfig({
host: "https://myhost.com",
namespace: "api/v1",
resourcePath: (resourceName) => {
return camelize(pluralize(resourceName));
}
});or is it too crazy and I should go to sleep ?
Contributor
Author
There was a problem hiding this comment.
go to sleep :P
This is mostly already configurable in this way though maybe we could make it even more configurable
Contributor
There was a problem hiding this comment.
Yeah I know you can configure it using builder options, but would be nice to have it in single place like it used to be in adapter. It would cover 90% cases, and you can still change it on builder level
runspired
added a commit
that referenced
this pull request
Feb 12, 2024
* feat: improve configurability of json-api builder and request-manager * fix types * add tests * fix prettier * fix forgottend debugger * fixup lint * fix lint
runspired
added a commit
that referenced
this pull request
Feb 12, 2024
* feat: improve configurability of json-api builder and request-manager * fix types * add tests * fix prettier * fix forgottend debugger * fixup lint * fix lint
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces two small features to improve extension and configuration
ember-data/storewill only create aRequestManagerif one does not exist.@ember-data/json-api/requestnow extends and re-exportssetBuildURLConfigto allow users to specify which json-api extensions and profiles are in use.