-
Notifications
You must be signed in to change notification settings - Fork 0
Enhance deployment and CI/CD workflows with API improvements and integrations #71
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -79,10 +79,11 @@ export default function WidgetSettingsPage() { | |||||||||||||||||||||||||||||||||||||||
| const res = await getBusinessProfile(); | ||||||||||||||||||||||||||||||||||||||||
| if (res.status === 'success' && res.data) { | ||||||||||||||||||||||||||||||||||||||||
| setBusiness(res.data); | ||||||||||||||||||||||||||||||||||||||||
| const d = res.data as unknown as Record<string, number | undefined>; | ||||||||||||||||||||||||||||||||||||||||
| setLimits({ | ||||||||||||||||||||||||||||||||||||||||
| allocated_messages_per_session: (res.data as Record<string, unknown>).allocated_messages_per_session, | ||||||||||||||||||||||||||||||||||||||||
| allocated_daily_sessions: (res.data as Record<string, unknown>).allocated_daily_sessions, | ||||||||||||||||||||||||||||||||||||||||
| allocated_whitelisted_domains: (res.data as Record<string, unknown>).allocated_whitelisted_domains, | ||||||||||||||||||||||||||||||||||||||||
| allocated_messages_per_session: d.allocated_messages_per_session, | ||||||||||||||||||||||||||||||||||||||||
| allocated_daily_sessions: d.allocated_daily_sessions, | ||||||||||||||||||||||||||||||||||||||||
| allocated_whitelisted_domains: d.allocated_whitelisted_domains, | ||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+82
to
87
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
83
to
88
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 This refactor is good for conciseness. To further improve type safety and make the expected data shape more explicit, you could use a more specific inline type for
Suggested change
|
||||||||||||||||||||||||||||||||||||||||
| } catch (e) { console.error(e); } | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
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.
The code uses an unsafe type assertion
as unknown as Record<string, number | undefined>on the data received from thegetBusinessProfileAPI call. This assumes the API response will always have the expected shape and types. If the API response changes, this could lead to runtime errors or unexpected behavior.