Comments (6)
Hi @stefan-willems-beech, can you please try using the following versions:
"@datx/core": "^2.4.8",
"@datx/jsonapi": "^2.4.8",
"@datx/jsonapi-angular": "^2.4.9",
"@datx/utils": "^2.4.8",
When using Angular, please use Angular's interceptors and not Datx's interceptors feature, as it is unnecessary next to Angular's interceptors.
Next, check out the instruction from @datx/jsonapi-angular docs for configuration, as there have been some changes in how the lib should be configured. We didn't communicate these changes in the best way, but if you were using CustomFetchService
and setting baseFetch
, that is no longer necessary and things should work with the new setup.
Your AppModule
might look something like this after all is set up:
@NgModule({
imports: [
DatxModule.forRoot({
baseUrl: 'https://my-api.com/'
})
],
providers: [
{
provide: APP_COLLECTION,
useValue: new AppCollection(),
},
{
provide: HTTP_INTERCEPTORS,
multi: true,
useClass: MyInterceptor
}
]
})
export class AppModule {}
from datx.
I'v tried the new versions of the packages
and I am still having this issue.
AppModule
@NgModule({
declarations: [
AppComponent,
],
imports: [
BrowserModule,
AuthenticationModule,
AppRoutingModule,
BrowserAnimationsModule,
HttpClientModule,
DatxModule,
],
providers: [
{
provide: APP_COLLECTION,
useValue: new AppCollection(),
},
],
bootstrap: [AppComponent]
})
export class AppModule {
}
AuthenticationModule
@NgModule({
imports: [
KeycloakAngularModule,
],
providers: [
{
provide: APP_INITIALIZER,
useFactory: initializeKeycloak,
multi: true,
deps: [KeycloakService],
},
{
provide: HTTP_INTERCEPTORS,
useClass: KeycloakBearerInterceptor,
multi: true
}
]
})
export class AuthenticationModule {
}
The current implementation is working without the datx implementation
from datx.
I've tried it without and with adding the KeycloakBearerInterceptor to the providers.
Because the KeycloakAngularModule provides the interceptor on default.
from datx.
For future reference:
I have updated the way the module is imported via the forRoot and changed the location of the baseUrl from the collection to the module.
This fixed the issue
this is my current AppModule
@NgModule({
declarations: [
AppComponent,
],
imports: [
BrowserModule,
AuthenticationModule,
AppRoutingModule,
BrowserAnimationsModule,
HttpClientModule,
DatxModule.forRoot({
cache: CachingStrategy.NetworkOnly,
baseUrl: environment.api_base_url,
})
],
providers: [
{
provide: APP_COLLECTION,
useValue: new AppCollection(),
},
],
bootstrap: [AppComponent]
})
export class AppModule {
}
from datx.
.forRoot
part was important because that is what makes DatX use Angular's HttpClient
instead of the native fetch
method (and Angular's interceptors do not work when using fetch
)
from datx.
Yeah figured that out when I followed the changes inside the documentation (didn't really consider it), my implementation is going through some validation and the imports of the module has changed.
Thanks for the clarification
from datx.
Related Issues (20)
- Map option not working properly with relationship. HOT 4
- Map option not working properly in combination with parse HOT 2
- Ability to send empty array or no relations on model.save() HOT 6
- Possible bug with generating post request HOT 3
- Cannot access 'Order' before initialization HOT 2
- [datx-jsonapi] - Support for node 18 fetch
- Search in documentation does not work properly HOT 2
- No export for setRefId
- [Proposal] - introduce new @Field decorator for jsonapi package instead of @Attribute
- Query parameters doubled
- mutate from useDatxInfinite doesn't work in useMutation HOT 1
- useMutation first parameter type error HOT 4
- Wrong return type on useDatxInfinite
- Datx - required trailing slash in the current state HOT 9
- Error: [MobX] Cannot apply `@action` to `t.prototype.removeOne` HOT 4
- Object is empty inside client after upgrade to v3 HOT 13
- Handle instances of DatX models beeing passed to "getRawData" function.
- Handle response content type
- Project setup issues due to a different global lerna version
- Make datx work with native fetch on node 20 / drop use of `isomorphic-fetch`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from datx.