Attach credentialId to location option

fix/missing-credential-id
Joe Au-Yeung 2023-10-25 14:10:32 -04:00
parent 1929b23ea8
commit 30183a9dc5
2 changed files with 9 additions and 3 deletions

View File

@ -298,7 +298,7 @@ export const EventSetupTab = (
!validLocations.find((location) => location.type === newLocationType);
if (canAddLocation) {
updateLocationField(index, { type: newLocationType });
updateLocationField(index, { type: newLocationType, credentialId: e.credentialId });
} else {
updateLocationField(index, { type: field.type });
showToast(t("location_already_exists"), "warning");
@ -382,7 +382,7 @@ export const EventSetupTab = (
!validLocations.find((location) => location.type === newLocationType);
if (canAppendLocation) {
append({ type: newLocationType });
append({ type: newLocationType, credentialId: e.credentialId });
setSelectedNewOption(e);
} else {
showToast(t("location_already_exists"), "warning");

View File

@ -88,7 +88,13 @@ export async function getLocationGroupedOptions(
teamName: credential.team?.name,
}))) {
const label = `${app.locationOption.label} ${teamName ? `(${teamName})` : ""}`;
const option = { ...app.locationOption, label, icon: app.logo, slug: app.slug };
const option = {
...app.locationOption,
label,
icon: app.logo,
slug: app.slug,
credentialId: app.credential.id,
};
if (apps[groupByCategory]) {
apps[groupByCategory] = [...apps[groupByCategory], option];
} else {