Attach credentialId to location option
parent
1929b23ea8
commit
30183a9dc5
|
@ -298,7 +298,7 @@ export const EventSetupTab = (
|
||||||
!validLocations.find((location) => location.type === newLocationType);
|
!validLocations.find((location) => location.type === newLocationType);
|
||||||
|
|
||||||
if (canAddLocation) {
|
if (canAddLocation) {
|
||||||
updateLocationField(index, { type: newLocationType });
|
updateLocationField(index, { type: newLocationType, credentialId: e.credentialId });
|
||||||
} else {
|
} else {
|
||||||
updateLocationField(index, { type: field.type });
|
updateLocationField(index, { type: field.type });
|
||||||
showToast(t("location_already_exists"), "warning");
|
showToast(t("location_already_exists"), "warning");
|
||||||
|
@ -382,7 +382,7 @@ export const EventSetupTab = (
|
||||||
!validLocations.find((location) => location.type === newLocationType);
|
!validLocations.find((location) => location.type === newLocationType);
|
||||||
|
|
||||||
if (canAppendLocation) {
|
if (canAppendLocation) {
|
||||||
append({ type: newLocationType });
|
append({ type: newLocationType, credentialId: e.credentialId });
|
||||||
setSelectedNewOption(e);
|
setSelectedNewOption(e);
|
||||||
} else {
|
} else {
|
||||||
showToast(t("location_already_exists"), "warning");
|
showToast(t("location_already_exists"), "warning");
|
||||||
|
|
|
@ -88,7 +88,13 @@ export async function getLocationGroupedOptions(
|
||||||
teamName: credential.team?.name,
|
teamName: credential.team?.name,
|
||||||
}))) {
|
}))) {
|
||||||
const label = `${app.locationOption.label} ${teamName ? `(${teamName})` : ""}`;
|
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]) {
|
if (apps[groupByCategory]) {
|
||||||
apps[groupByCategory] = [...apps[groupByCategory], option];
|
apps[groupByCategory] = [...apps[groupByCategory], option];
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue