-
Notifications
You must be signed in to change notification settings - Fork 20
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
Allow users to configure backend API and frontend client #101
Conversation
@@ -16,7 +16,7 @@ const theme = createTheme({}); | |||
|
|||
// Relates to path("ai-assistant/", include("django_ai_assistant.urls")) | |||
// which can be found at example/demo/urls.py) | |||
configAIAssistant({ baseURL: "ai-assistant" }); | |||
configAIAssistant({ BASE: "ai-assistant" }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this has changed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because we are now using the OpenAPIConfig
as props to make override the client config easier.
django-ai-assistant/frontend/src/client/core/OpenAPI.ts
Lines 43 to 57 in ca39c19
export const OpenAPI: OpenAPIConfig = { | |
BASE: '', | |
CREDENTIALS: 'include', | |
ENCODE_PATH: undefined, | |
HEADERS: undefined, | |
PASSWORD: undefined, | |
TOKEN: undefined, | |
USERNAME: undefined, | |
VERSION: '0.0.1', | |
WITH_CREDENTIALS: false, | |
interceptors: { | |
request: new Interceptors(), | |
response: new Interceptors(), | |
}, | |
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good. Please check comments.
Co-authored-by: Flávio Juvenal <flavio@vinta.com.br>
Issues
Resolves #55
Description
Allow users to configure backend API (Django Ninja) and frontend client (openapi-ts)
Screencast.from.19-06-2024.15.30.24.webm