fix: Connect selected calendar to credential (#11283)
release.yml / release (push) Canceled after 0s
release.yml / release (push) Canceled after 0s
* Reduce the unhandled promise * Connect selected calendar to credential * Write credential to selected calendar * Type fix * Handle catching promises in separate threads * Only call to list calendars if there are no credentialIds * Changed type of IntegrationCalendar from undef to null * Adding missing property to getting started * Also add calendars.tsx --------- Co-authored-by: Alex van Andel <[email protected]>
This commit is contained in:
1 parent
1c1625d3fc
commit
3d4a3c7a93
9 files changed
+64
-40
No files matched your search
@@ -15,9 +15,10 @@ interface ICalendarSwitchProps {
|
||||
name: string;
|
||||
isLastItemInList?: boolean;
|
||||
destination?: boolean;
|
||||
credentialId: number;
|
||||
}
|
||||
const CalendarSwitch = (props: ICalendarSwitchProps) => {
|
||||
const { title, externalId, type, isChecked, name, isLastItemInList = false } = props;
|
||||
const { title, externalId, type, isChecked, name, isLastItemInList = false, credentialId } = props;
|
||||
const [checkedInternal, setCheckedInternal] = useState(isChecked);
|
||||
const utils = trpc.useContext();
|
||||
const { t } = useLocale();
|
||||
@@ -40,7 +41,7 @@ const CalendarSwitch = (props: ICalendarSwitchProps) => {
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(body),
|
||||
body: JSON.stringify({ ...body, credentialId }),
|
||||
});
|
||||
|
||||
if (!res.ok) {
|
||||
|
||||
Reference in new issue
Block a user