Add orgid to install/uninstall
This commit is contained in:
parent
6d673da128
commit
90c8057e7d
|
@ -10,8 +10,8 @@ import { Button } from "@calcom/ui";
|
||||||
import { Dropdown } from "@calcom/ui";
|
import { Dropdown } from "@calcom/ui";
|
||||||
|
|
||||||
type AppInstallButtonProps = {
|
type AppInstallButtonProps = {
|
||||||
onInstall: (userId: string) => void;
|
onInstall: (userId: string, orgId?: string) => void;
|
||||||
onUninstall: (userId: string) => void;
|
onUninstall: (userId: string, orgId?: string) => void;
|
||||||
users: {
|
users: {
|
||||||
id: string;
|
id: string;
|
||||||
orgId?: string; // present if org
|
orgId?: string; // present if org
|
||||||
|
@ -30,13 +30,21 @@ export function AppInstallButton(props: AppInstallButtonProps) {
|
||||||
if (users.length === 1) {
|
if (users.length === 1) {
|
||||||
if (!users[0].installed) {
|
if (!users[0].installed) {
|
||||||
return (
|
return (
|
||||||
<Button onClick={() => onInstall(users[0].id)} color="secondary" size="sm" StartIcon={PlusIcon}>
|
<Button
|
||||||
|
onClick={() => onInstall(users[0].id, users[0].orgId)}
|
||||||
|
color="secondary"
|
||||||
|
size="sm"
|
||||||
|
StartIcon={PlusIcon}>
|
||||||
{t("install")}
|
{t("install")}
|
||||||
</Button>
|
</Button>
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return (
|
return (
|
||||||
<Button onClick={() => onUninstall(users[0].id)} color="secondary" size="sm" StartIcon={PlusIcon}>
|
<Button
|
||||||
|
onClick={() => onUninstall(users[0].id, users[0].orgId)}
|
||||||
|
color="secondary"
|
||||||
|
size="sm"
|
||||||
|
StartIcon={PlusIcon}>
|
||||||
{t("uninstall")}
|
{t("uninstall")}
|
||||||
</Button>
|
</Button>
|
||||||
);
|
);
|
||||||
|
@ -59,7 +67,7 @@ export function AppInstallButton(props: AppInstallButtonProps) {
|
||||||
key={user.id}
|
key={user.id}
|
||||||
className="flex h-9 flex-1 items-center space-x-2 pl-3"
|
className="flex h-9 flex-1 items-center space-x-2 pl-3"
|
||||||
onSelect={() => {
|
onSelect={() => {
|
||||||
user.installed ? onUninstall(user.id) : onInstall(user.id);
|
user.installed ? onUninstall(user.id, user.orgId) : onInstall(user.id, user.orgId);
|
||||||
}}>
|
}}>
|
||||||
<div className="h-5 w-5">
|
<div className="h-5 w-5">
|
||||||
<Avatar
|
<Avatar
|
||||||
|
|
Loading…
Reference in New Issue
Block a user