fix: broken integration
This commit is contained in:
@@ -21,13 +21,12 @@ export function DiscordIntegrationForm({
|
|||||||
defaultValues?: RouterOutputs['integration']['get'];
|
defaultValues?: RouterOutputs['integration']['get'];
|
||||||
onSuccess: () => void;
|
onSuccess: () => void;
|
||||||
}) {
|
}) {
|
||||||
const { organizationId, projectId } = useAppParams();
|
const { organizationId } = useAppParams();
|
||||||
const form = useForm<IForm>({
|
const form = useForm<IForm>({
|
||||||
defaultValues: mergeDeepRight(
|
defaultValues: mergeDeepRight(
|
||||||
{
|
{
|
||||||
id: defaultValues?.id,
|
id: defaultValues?.id,
|
||||||
organizationId,
|
organizationId,
|
||||||
projectId,
|
|
||||||
config: {
|
config: {
|
||||||
type: 'discord' as const,
|
type: 'discord' as const,
|
||||||
url: '',
|
url: '',
|
||||||
|
|||||||
@@ -19,13 +19,12 @@ export function SlackIntegrationForm({
|
|||||||
defaultValues?: RouterOutputs['integration']['get'];
|
defaultValues?: RouterOutputs['integration']['get'];
|
||||||
onSuccess: () => void;
|
onSuccess: () => void;
|
||||||
}) {
|
}) {
|
||||||
const { organizationId, projectId } = useAppParams();
|
const { organizationId } = useAppParams();
|
||||||
|
|
||||||
const form = useForm<IForm>({
|
const form = useForm<IForm>({
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
id: defaultValues?.id,
|
id: defaultValues?.id,
|
||||||
organizationId,
|
organizationId,
|
||||||
projectId,
|
|
||||||
name: defaultValues?.name ?? '',
|
name: defaultValues?.name ?? '',
|
||||||
},
|
},
|
||||||
resolver: zodResolver(zCreateSlackIntegration),
|
resolver: zodResolver(zCreateSlackIntegration),
|
||||||
|
|||||||
@@ -25,8 +25,7 @@ export const slackInstaller = SLACK_CLIENT_ID
|
|||||||
export const getSlackInstallUrl = ({
|
export const getSlackInstallUrl = ({
|
||||||
integrationId,
|
integrationId,
|
||||||
organizationId,
|
organizationId,
|
||||||
projectId,
|
}: { integrationId: string; organizationId: string }) => {
|
||||||
}: { integrationId: string; organizationId: string; projectId: string }) => {
|
|
||||||
if (!SLACK_CLIENT_ID) {
|
if (!SLACK_CLIENT_ID) {
|
||||||
throw new Error('SLACK_CLIENT_ID is not set (slack.ts)');
|
throw new Error('SLACK_CLIENT_ID is not set (slack.ts)');
|
||||||
}
|
}
|
||||||
@@ -38,7 +37,7 @@ export const getSlackInstallUrl = ({
|
|||||||
'team:read',
|
'team:read',
|
||||||
],
|
],
|
||||||
redirectUri: SLACK_OAUTH_REDIRECT_URL,
|
redirectUri: SLACK_OAUTH_REDIRECT_URL,
|
||||||
metadata: JSON.stringify({ integrationId, organizationId, projectId }),
|
metadata: JSON.stringify({ integrationId, organizationId }),
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -121,16 +121,19 @@ export const eventsGroupQueue = new GroupQueue<
|
|||||||
});
|
});
|
||||||
|
|
||||||
export const sessionsQueue = new Queue<SessionsQueuePayload>('sessions', {
|
export const sessionsQueue = new Queue<SessionsQueuePayload>('sessions', {
|
||||||
|
// @ts-ignore
|
||||||
connection: getRedisQueue(),
|
connection: getRedisQueue(),
|
||||||
defaultJobOptions: {
|
defaultJobOptions: {
|
||||||
removeOnComplete: 10,
|
removeOnComplete: 10,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
export const sessionsQueueEvents = new QueueEvents('sessions', {
|
export const sessionsQueueEvents = new QueueEvents('sessions', {
|
||||||
|
// @ts-ignore
|
||||||
connection: getRedisQueue(),
|
connection: getRedisQueue(),
|
||||||
});
|
});
|
||||||
|
|
||||||
export const cronQueue = new Queue<CronQueuePayload>('cron', {
|
export const cronQueue = new Queue<CronQueuePayload>('cron', {
|
||||||
|
// @ts-ignore
|
||||||
connection: getRedisQueue(),
|
connection: getRedisQueue(),
|
||||||
defaultJobOptions: {
|
defaultJobOptions: {
|
||||||
removeOnComplete: 10,
|
removeOnComplete: 10,
|
||||||
@@ -138,6 +141,7 @@ export const cronQueue = new Queue<CronQueuePayload>('cron', {
|
|||||||
});
|
});
|
||||||
|
|
||||||
export const miscQueue = new Queue<MiscQueuePayload>('misc', {
|
export const miscQueue = new Queue<MiscQueuePayload>('misc', {
|
||||||
|
// @ts-ignore
|
||||||
connection: getRedisQueue(),
|
connection: getRedisQueue(),
|
||||||
defaultJobOptions: {
|
defaultJobOptions: {
|
||||||
removeOnComplete: 10,
|
removeOnComplete: 10,
|
||||||
@@ -154,6 +158,7 @@ export type NotificationQueuePayload = {
|
|||||||
export const notificationQueue = new Queue<NotificationQueuePayload>(
|
export const notificationQueue = new Queue<NotificationQueuePayload>(
|
||||||
'notification',
|
'notification',
|
||||||
{
|
{
|
||||||
|
// @ts-ignore
|
||||||
connection: getRedisQueue(),
|
connection: getRedisQueue(),
|
||||||
defaultJobOptions: {
|
defaultJobOptions: {
|
||||||
removeOnComplete: 10,
|
removeOnComplete: 10,
|
||||||
|
|||||||
@@ -69,7 +69,6 @@ export const integrationRouter = createTRPCRouter({
|
|||||||
slackInstallUrl: await getSlackInstallUrl({
|
slackInstallUrl: await getSlackInstallUrl({
|
||||||
integrationId: res.id,
|
integrationId: res.id,
|
||||||
organizationId: input.organizationId,
|
organizationId: input.organizationId,
|
||||||
projectId: input.projectId,
|
|
||||||
}),
|
}),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -88,7 +87,6 @@ export const integrationRouter = createTRPCRouter({
|
|||||||
slackInstallUrl: await getSlackInstallUrl({
|
slackInstallUrl: await getSlackInstallUrl({
|
||||||
integrationId: res.id,
|
integrationId: res.id,
|
||||||
organizationId: input.organizationId,
|
organizationId: input.organizationId,
|
||||||
projectId: input.projectId,
|
|
||||||
}),
|
}),
|
||||||
};
|
};
|
||||||
}),
|
}),
|
||||||
|
|||||||
@@ -302,7 +302,6 @@ const zCreateIntegration = z.object({
|
|||||||
id: z.string().optional(),
|
id: z.string().optional(),
|
||||||
name: z.string().min(1),
|
name: z.string().min(1),
|
||||||
organizationId: z.string().min(1),
|
organizationId: z.string().min(1),
|
||||||
projectId: z.string().min(1),
|
|
||||||
});
|
});
|
||||||
|
|
||||||
export const zCreateSlackIntegration = zCreateIntegration;
|
export const zCreateSlackIntegration = zCreateIntegration;
|
||||||
|
|||||||
Reference in New Issue
Block a user